Assembly: PresentationCore (in presentationcore.dll)
'Declaration Public Delegate Sub RoutedEventHandler ( _ sender As Object, _ e As RoutedEventArgs _ ) 'Usage Dim instance As New RoutedEventHandler(AddressOf HandlerMethod)
/** @delegate */ public delegate void RoutedEventHandler ( Object sender, RoutedEventArgs e )
The element where the handler is being invoked.
RoutedEventArgs event arguments that contain information about the routed event, including the event source element.
This example shows how to find the source element in an event handler.
The following example shows a Click event handler that is declared in a code-behind file. When a user clicks the button that the handler is attached to, the handler changes a property value. The handler code uses the Source property of the routed event data that is reported in the event arguments to change the Width property value on the Source element.
Public Sub HandleClick(ByVal sender As Object, ByVal e As RoutedEventArgs) 'You must cast the object as a Button element, or at least as FrameworkElement, to set Width Dim srcButton As Button srcButton = CType(e.Source, Button) srcButton.Width = 200 End Sub
For the complete sample, see Finding the Source Element in an Event Handler Sample.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.