- e
- A RoutedPropertyChangedEventArgs that contains the event data.
Visual Basic (Declaration) | |
---|---|
Protected Overridable Sub OnItemStyleChanged( _ ByVal e As RoutedPropertyChangedEventArgs(Of ImageListItemStyle) _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As ImageList Dim e As RoutedPropertyChangedEventArgs(Of ImageListItemStyle) instance.OnItemStyleChanged(e) |
C# | |
---|---|
protected virtual void OnItemStyleChanged( RoutedPropertyChangedEventArgs<ImageListItemStyle> e ) |
C++/CLI | |
---|---|
protected: virtual void OnItemStyleChanged( RoutedPropertyChangedEventArgs<ImageListItemStyle>^ e ) |
Parameters
- e
- A RoutedPropertyChangedEventArgs that contains the event data.
Visual Basic | Copy Code |
---|---|
Public Class MyImageList : Inherits ImageList '. '. '. Protected Overrides Sub OnItemImageSizeChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Size)) MyBase.OnItemImageSizeChanged(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 OnOrientationChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Orientation)) MyBase.OnOrientationChanged(e) Console.WriteLine("OnOrientationChanged is called") End Sub Protected Overrides Sub OnItemStyleChanged(ByVal e As RoutedPropertyChangedEventArgs(Of ImageListItemStyle)) MyBase.OnItemStyleChanged(e) Console.WriteLine("OnItemStyleChanged 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 OnItemImageSizeChanged(RoutedPropertyChangedEventArgs<Size> e) { base.OnItemImageSizeChanged(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 OnOrientationChanged(RoutedPropertyChangedEventArgs<Orientation> e) { base.OnOrientationChanged(e); Console.WriteLine("OnOrientationChanged is called"); } protected override void OnItemStyleChanged(RoutedPropertyChangedEventArgs<ImageListItemStyle> e) { base.OnItemStyleChanged(e); Console.WriteLine("OnItemStyleChanged 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"); } |
SilverlightCSharp | Copy Code |
---|---|
public class MyImageList : ImageList { //. //. //. protected override void OnItemImageSizeChanged(RoutedPropertyChangedEventArgs<Size> e) { base.OnItemImageSizeChanged(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 OnOrientationChanged(RoutedPropertyChangedEventArgs<Orientation> e) { base.OnOrientationChanged(e); Console.WriteLine("OnOrientationChanged is called"); } protected override void OnItemStyleChanged(RoutedPropertyChangedEventArgs<ImageListItemStyle> e) { base.OnItemStyleChanged(e); Console.WriteLine("OnItemStyleChanged 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"); } |
SilverlightVB | Copy Code |
---|---|
Public Class MyImageList : Inherits ImageList '. '. '. Protected Overrides Sub OnItemImageSizeChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Size)) MyBase.OnItemImageSizeChanged(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 OnOrientationChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Orientation)) MyBase.OnOrientationChanged(e) Console.WriteLine("OnOrientationChanged is called") End Sub Protected Overrides Sub OnItemStyleChanged(ByVal e As RoutedPropertyChangedEventArgs(Of ImageListItemStyle)) MyBase.OnItemStyleChanged(e) Console.WriteLine("OnItemStyleChanged 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 |
Raising an event invokes the event handler through a delegate.
The OnItemStyleChanged 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 OnItemStyleChanged in a derived class, be sure to call the base class's OnItemStyleChanged method so that registered delegates receive the event.
Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family