語言

KeyboardAcceleratorInvokedEventArgs.Handled 屬性

定義

取得或設定一個標記事件已處理的值。

public:
 property bool Handled { bool get(); void set(bool value); };
bool Handled();

void Handled(bool value);
public bool Handled { get; set; }
var boolean = keyboardAcceleratorInvokedEventArgs.handled;
keyboardAcceleratorInvokedEventArgs.handled = boolean;
Public Property Handled As Boolean

屬性值

Boolean

bool

true 以標示事件已處理; false 讓事件不處理,讓事件有可能繼續路由。 預設值為 false。

備註

鍵盤加速器事件會從擁有焦點的元素冒泡到根視窗元素。 如果事件未被處理,框架會利用一個全域加速器表尋找冒泡路徑外的其他加速器。 除非使用 ScopeOwner 範圍範圍,否則所有加速器皆為全域註冊。

只有當焦點在特定範圍內時,才會啟動有示波加速器。 例如,在包含多個控制項的 中 Grid ,加速器可以與作用範圍的 Grid 控制項(即 GridScopeOwner)相關聯。 在此情況下,根元素為 Grid。

若兩個加速器使用相同的金鑰組合,則會呼叫表中第一個加速器。

適用於

另請參閱