CommandBinding.PreviewExecuted 事件

定義

與此 CommandBinding 相關聯的命令執行時發生。Occurs when the command associated with this CommandBinding executes.

public:
 event System::Windows::Input::ExecutedRoutedEventHandler ^ PreviewExecuted;
public event System.Windows.Input.ExecutedRoutedEventHandler PreviewExecuted;
member this.PreviewExecuted : System.Windows.Input.ExecutedRoutedEventHandler 
Public Custom Event PreviewExecuted As ExecutedRoutedEventHandler 
Public Event PreviewExecuted As ExecutedRoutedEventHandler 

備註

RoutedCommand 執行時,它會引發命令目標上的 PreviewExecuted 事件。When a RoutedCommand executes, it raises the PreviewExecuted event on the command target. 如果命令目標具有命令的 CommandBinding,就會呼叫該 CommandBindingPreviewExecuted 處理常式。If the command target has a CommandBinding for the command the PreviewExecuted handler for that CommandBinding is called. 如果命令目標沒有命令的 CommandBindingPreviewExecuted 事件會在專案樹狀結構之下,搜尋具有與命令相關聯之 CommandBinding 的元素。If the command target does not have a CommandBinding for the command the PreviewExecuted event tunnels down the element tree searching for an element that has a CommandBinding associated with the command. 如果未處理預覽事件,則會在命令目標上引發 Executed 事件。If the preview event is not handled, the Executed event is raised on command target.

路由事件資訊Routed Event Information

識別碼欄位Identifier field PreviewExecutedEvent
路由策略Routing strategy 通道Tunneling
委派Delegate ExecutedRoutedEventHandler
  • 對應的反升事件為 ExecutedThe corresponding bubbling event is Executed.

適用於

另請參閱