ExecutedRoutedEventArgs Class
Provides data for the Executed and PreviewExecuted routed events.
Assembly: PresentationCore (in PresentationCore.dll)
ExecutedRoutedEventHandler represents the method that implements the command logic of a RoutedCommand. Separating the implementation logic from the command allows the command to be invoked from different sources and types and enables the centralization of command logic.
This event data class is also used for CommandManager.Executed and CommandManager.PreviewExecuted. But most practical handlers will handle the Executed events from a particular CommandBinding, rather than work at the CommandManager level.
For more information on commanding, see Commanding Overview.
The following example creates an ExecutedRoutedEventHandler that opens a MessageBox when the command is executed.
Private Sub OpenCmdExecuted(ByVal sender As Object, ByVal e As ExecutedRoutedEventArgs) Dim command, targetobj As String command = CType(e.Command, RoutedCommand).Name targetobj = CType(sender, FrameworkElement).Name MessageBox.Show("The " + command + " command has been invoked on target object " + targetobj) End Sub
System.EventArgs
System.Windows.RoutedEventArgs
System.Windows.Input.ExecutedRoutedEventArgs
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.