ExecutedRoutedEventArgs 類別

定義

ExecutedPreviewExecuted 路由事件提供資料。Provides data for the Executed and PreviewExecuted routed events.

public ref class ExecutedRoutedEventArgs sealed : System::Windows::RoutedEventArgs
public sealed class ExecutedRoutedEventArgs : System.Windows.RoutedEventArgs
type ExecutedRoutedEventArgs = class
    inherit RoutedEventArgs
Public NotInheritable Class ExecutedRoutedEventArgs
Inherits RoutedEventArgs
繼承
ExecutedRoutedEventArgs

範例

下列範例ExecutedRoutedEventHandler MessageBox會建立, 它會在執行命令時開啟。The following example creates an ExecutedRoutedEventHandler that opens a MessageBox when the command is executed.

void OpenCmdExecuted(object target, ExecutedRoutedEventArgs e)
{
    String command, targetobj;
    command = ((RoutedCommand)e.Command).Name;
    targetobj = ((FrameworkElement)target).Name;
    MessageBox.Show("The " + command +  " command has been invoked on target object " + targetobj);
}
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

備註

ExecutedRoutedEventHandler表示可執行RoutedCommand之命令邏輯的方法。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.

這個事件資料類別也用於CommandManager.Executed和。 CommandManager.PreviewExecutedThis event data class is also used for CommandManager.Executed and CommandManager.PreviewExecuted. 但是, 大部分的Executed實際處理常式將會處理特定CommandBinding的事件, CommandManager而不是在層級工作。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.

屬性

Command

取得已叫用的命令。Gets the command that was invoked.

Handled

取得或設定值,這個值表示路由事件在傳送路由時之事件處理的目前狀態。Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.

(繼承來源 RoutedEventArgs)
OriginalSource

在父類別進行任何可能的 Source 調整之前,取得純點擊測試所判定的原始報告來源。Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.

(繼承來源 RoutedEventArgs)
Parameter

取得命令的資料參數。Gets data parameter of the command.

RoutedEvent

取得或設定與這個 RoutedEventArgs 執行個體相關聯的 RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance.

(繼承來源 RoutedEventArgs)
Source

取得或設定引發事件之物件的參考。Gets or sets a reference to the object that raised the event.

(繼承來源 RoutedEventArgs)

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InvokeEventHandler(Delegate, Object)

在衍生類別中覆寫時,提供以特定類型方式叫用事件處理常式的方式,這可透過基底實作來提高效率。When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation.

(繼承來源 RoutedEventArgs)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnSetSource(Object)

在衍生類別中覆寫時,每當執行個體的 Source 屬性值變更,便會提供通知回呼進入點。When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.

(繼承來源 RoutedEventArgs)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱