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




e
An RoutedEventArgs that contains the event data.
Raises the OuterBrushChanged event.

Syntax

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

Parameters

e
An RoutedEventArgs that contains the event data.

Example

This example overrides the virtual events of the ImagePanViewer class.

Visual BasicCopy Code
Public Class MyImagePanViewer : Inherits ImagePanViewer
   '.
   '.
   '.
   Protected Overrides Sub OnSourceChanged(ByVal e As RoutedPropertyChangedEventArgs(Of BitmapSourceViewer))
      MyBase.OnSourceChanged(e)
      Console.WriteLine("OnSourceChanged is called")
   End Sub

   Protected Overrides Sub OnRectanglePenChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Pen))
      MyBase.OnRectanglePenChanged(e)

      Console.WriteLine("OnRectangleColorChanged is called")
   End Sub

   Protected Overrides Sub OnInnerBrushChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Brush))
      MyBase.OnInnerBrushChanged(e)

      Console.WriteLine("OnInnerBrushChanged is called")
   End Sub

   Protected Overrides Sub OnOuterBrushChanged(ByVal e As RoutedPropertyChangedEventArgs(Of Brush))
      MyBase.OnOuterBrushChanged(e)

      Console.WriteLine("OnOuterBrushChanged is called")
   End Sub

   Protected Overrides Sub OnRender(ByVal drawingContext As DrawingContext)
      MyBase.OnRender(drawingContext)

      Console.WriteLine("OnRender is called")
   End Sub

   Protected Overrides Sub OnMouseLeftButtonDown(ByVal e As MouseButtonEventArgs)
      MyBase.OnMouseLeftButtonDown(e)

      Console.WriteLine("OnMouseLeftButtonDown is called")
   End Sub

   Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
      MyBase.OnMouseMove(e)

      Console.WriteLine("OnMouseMove is called")
   End Sub

   Protected Overrides Sub OnMouseLeftButtonUp(ByVal e As MouseButtonEventArgs)
      MyBase.OnMouseLeftButtonUp(e)

      Console.WriteLine("OnMouseLeftButtonUp is called")
   End Sub
End Class
C#Copy Code
public class MyImagePanViewer : ImagePanViewer 

   //. 
   //. 
   //. 
   protected override void OnSourceChanged(RoutedPropertyChangedEventArgs<BitmapSourceViewer> e) 
   { 
      base.OnSourceChanged(e); 
      Console.WriteLine("OnSourceChanged is called"); 
   } 
 
   protected override void OnRectanglePenChanged(RoutedPropertyChangedEventArgs<Pen> e) 
   { 
      base.OnRectanglePenChanged(e); 
 
      Console.WriteLine("OnRectangleColorChanged is called"); 
   } 
 
   protected override void OnInnerBrushChanged(RoutedPropertyChangedEventArgs<Brush> e) 
   { 
      base.OnInnerBrushChanged(e); 
 
      Console.WriteLine("OnInnerBrushChanged is called"); 
   } 
 
   protected override void OnOuterBrushChanged(RoutedPropertyChangedEventArgs<Brush> e) 
   { 
      base.OnOuterBrushChanged(e); 
 
      Console.WriteLine("OnOuterBrushChanged is called"); 
   } 
 
   protected override void  OnRender(DrawingContext drawingContext) 
   { 
       base.OnRender(drawingContext); 
 
      Console.WriteLine("OnRender is called"); 
   } 
 
   protected override void  OnMouseLeftButtonDown(MouseButtonEventArgs e) 
   { 
       base.OnMouseLeftButtonDown(e); 
 
      Console.WriteLine("OnMouseLeftButtonDown is called"); 
   } 
 
   protected override void OnMouseMove(MouseEventArgs e) 
   { 
      base.OnMouseMove(e); 
 
      Console.WriteLine("OnMouseMove is called"); 
   } 
 
   protected override void  OnMouseLeftButtonUp(MouseButtonEventArgs e) 
   { 
      base.OnMouseLeftButtonUp(e); 
 
      Console.WriteLine("OnMouseLeftButtonUp is called"); 
   } 
}

Remarks

Raising an event invokes the event handler through a delegate. The OnOuterBrushChanged 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 OnOuterBrushChanged in a derived class, be sure to call the base class's OnOuterBrushChanged 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