Leadtools.Windows.Controls Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.03.25
OnViewStyleChanged Method
See Also  Example
Leadtools.Windows.Controls Namespace > ImageList Class : OnViewStyleChanged Method




e
An RoutedPropertyChangedEventArgs that contains the event data.
Raises the ViewStyleChanged event.

Syntax

Visual Basic (Declaration) 
Protected Overridable Sub OnViewStyleChanged( _
   ByVal e As RoutedPropertyChangedEventArgs(Of ImageListViewStyle) _
) 
Visual Basic (Usage)Copy Code
Dim instance As ImageList
Dim e As RoutedPropertyChangedEventArgs(Of ImageListViewStyle)
 
instance.OnViewStyleChanged(e)
C# 
protected virtual void OnViewStyleChanged( 
   RoutedPropertyChangedEventArgs<ImageListViewStyle> e
)
Managed Extensions for C++ 
protected: virtual void OnViewStyleChanged( 
   RoutedPropertyChangedEventArgs<ImageListViewStyle> e
) 
C++/CLI 
protected:
virtual void OnViewStyleChanged( 
   RoutedPropertyChangedEventArgs<ImageListViewStyle> e
) 

Parameters

e
An RoutedPropertyChangedEventArgs that contains the event data.

Example

This example overrides the virtual events of the ImageList class.

Visual BasicCopy Code
Public Class MyImageList : Inherits ImageList
   '.
   '.
   '.
   Protected Overrides Sub OnImageSizeChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Size))
      MyBase.OnImageSizeChanged(e)
      Console.WriteLine("OnImageSizeChanged is called")
   End Sub
   Protected Overrides Sub OnItemBorderBrushChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Brush))
      MyBase.OnItemBorderBrushChanged(e)
      Console.WriteLine("OnItemBorderBrushChanged is called")
   End Sub

   Protected Overrides Sub OnItemBorderThicknessChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Thickness))
      MyBase.OnItemBorderThicknessChanged(e)
      Console.WriteLine("OnItemBorderThicknessChanged is called")
   End Sub

   Protected Overrides Sub OnItemSelectedBackgroundChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Brush))
      MyBase.OnItemSelectedBackgroundChanged(e)
      Console.WriteLine("OnItemSelectedBackgroundChanged is called")
   End Sub

   Protected Overrides Sub OnItemSelectedForegroundChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Brush))
      MyBase.OnItemSelectedForegroundChanged(e)
      Console.WriteLine("OnItemSelectedForegroundChanged is called")
   End Sub

   Protected Overrides Sub OnItemSizeChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Size))
      MyBase.OnItemSizeChanged(e)
      Console.WriteLine("OnItemSizeChanged is called")
   End Sub

   Protected Overrides Sub OnScrollStyleChanged(ByVal e As RoutedPropertyChangedEventArgs(Of ImageListScrollStyle))
      MyBase.OnScrollStyleChanged(e)
      Console.WriteLine("OnScrollStyleChanged is called")
   End Sub

   Protected Overrides Sub OnViewStyleChanged(ByVal e As RoutedPropertyChangedEventArgs(Of ImageListViewStyle))
      MyBase.OnViewStyleChanged(e)
      Console.WriteLine("OnViewStyleChanged is called")
   End Sub

   Protected Overrides Sub OnShowTextChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Boolean))
      MyBase.OnShowTextChanged(e)
      Console.WriteLine("OnShowTextChanged is called")
   End Sub

   Protected Overrides Sub OnItemBackgroundChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Brush))
      MyBase.OnItemBackgroundChanged(e)
      Console.WriteLine("OnItemBackgroundChanged is called")
   End Sub

   Protected Overrides Sub OnItemForegroundChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Brush))
      MyBase.OnItemForegroundChanged(e)
      Console.WriteLine("OnItemForegroundChanged is called")
   End Sub

   Protected Overrides Sub OnItemMarginChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Thickness))
      MyBase.OnItemMarginChanged(e)
      Console.WriteLine("OnItemMarginChanged is called")
   End Sub
C#Copy Code
public class MyImageList : ImageList 

   //. 
   //. 
   //. 
   protected override void OnImageSizeChanged(RoutedPropertyChangedEventArgs<Size> e) 
   { 
      base.OnImageSizeChanged(e); 
      Console.WriteLine("OnImageSizeChanged is called"); 
   } 
   protected override void OnItemBorderBrushChanged(RoutedPropertyChangedEventArgs<Brush> e) 
   { 
      base.OnItemBorderBrushChanged(e); 
      Console.WriteLine("OnItemBorderBrushChanged is called"); 
   } 
 
   protected override void OnItemBorderThicknessChanged(RoutedPropertyChangedEventArgs<Thickness> e) 
   { 
      base.OnItemBorderThicknessChanged(e); 
      Console.WriteLine("OnItemBorderThicknessChanged is called"); 
   } 
 
   protected override void OnItemSelectedBackgroundChanged(RoutedPropertyChangedEventArgs<Brush> e) 
   { 
      base.OnItemSelectedBackgroundChanged(e); 
      Console.WriteLine("OnItemSelectedBackgroundChanged is called"); 
   } 
 
   protected override void OnItemSelectedForegroundChanged(RoutedPropertyChangedEventArgs<Brush> e) 
   { 
      base.OnItemSelectedForegroundChanged(e); 
      Console.WriteLine("OnItemSelectedForegroundChanged is called"); 
   } 
 
   protected override void OnItemSizeChanged(RoutedPropertyChangedEventArgs<Size> e) 
   { 
      base.OnItemSizeChanged(e); 
      Console.WriteLine("OnItemSizeChanged is called"); 
   } 
 
   protected override void OnScrollStyleChanged(RoutedPropertyChangedEventArgs<ImageListScrollStyle> e) 
   { 
      base.OnScrollStyleChanged(e); 
      Console.WriteLine("OnScrollStyleChanged is called"); 
   } 
 
   protected override void OnViewStyleChanged(RoutedPropertyChangedEventArgs<ImageListViewStyle> e) 
   { 
      base.OnViewStyleChanged(e); 
      Console.WriteLine("OnViewStyleChanged is called"); 
   } 
 
   protected override void OnShowTextChanged(RoutedPropertyChangedEventArgs<bool> e) 
   { 
      base.OnShowTextChanged(e); 
      Console.WriteLine("OnShowTextChanged is called"); 
   } 
 
   protected override void OnItemBackgroundChanged(RoutedPropertyChangedEventArgs<Brush> e) 
   { 
      base.OnItemBackgroundChanged(e); 
      Console.WriteLine("OnItemBackgroundChanged is called"); 
   } 
 
   protected override void OnItemForegroundChanged(RoutedPropertyChangedEventArgs<Brush> e) 
   { 
      base.OnItemForegroundChanged(e); 
      Console.WriteLine("OnItemForegroundChanged is called"); 
   } 
 
   protected override void OnItemMarginChanged(RoutedPropertyChangedEventArgs<Thickness> e) 
   { 
      base.OnItemMarginChanged(e); 
      Console.WriteLine("OnItemMarginChanged is called"); 
   }

Remarks

Raising an event invokes the event handler through a delegate.

The OnViewStyleChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors: When overriding OnViewStyleChanged in a derived class, be sure to call the base class's OnViewStyleChanged method so that registered delegates receive the event.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also