FocusManager.FocusedElement 附加屬性

定義

判斷附加這個屬性的項目是否擁有邏輯焦點。

see GetFocusedElement, and SetFocusedElement
see GetFocusedElement, and SetFocusedElement
see GetFocusedElement, and SetFocusedElement

範例

下列範例示範如何建立 Button 焦點專案。

<StackPanel FocusManager.FocusedElement="{Binding ElementName=firstButton}">
  <Button Name="firstButton" />
</StackPanel>

備註

FocusedElement是具有特定焦點範圍之邏輯焦點的專案。 此物件可能或可能沒有鍵盤焦點。 鍵盤焦點是指接收鍵盤輸入的專案。 如需焦點、鍵盤焦點和邏輯焦點的詳細資訊,請參閱 輸入概觀

GetFocusedElementSetFocusedElement 可用來取得和設定指定焦點範圍內的焦點專案。

相依性屬性資訊

標識元欄位 FocusedElementProperty
設定為的元數據屬性 true

適用於