FocusManager.IsFocusScope 附加屬性

定義

判斷附加這個屬性的項目是否為焦點範圍。

C#
see GetIsFocusScope, and SetIsFocusScope

範例

下列範例會建立 StackPanel 焦點範圍。

XML
<StackPanel Name="focusScope1" 
            FocusManager.IsFocusScope="True"
            Height="200" Width="200">
  <Button Name="button1" Height="50" Width="50"/>
  <Button Name="button2" Height="50" Width="50"/>
</StackPanel>

備註

焦點範圍是可追蹤其範圍內 之的 FocusManager.FocusedElement 容器專案。 根據預設,類別 Window 是焦點範圍,如同 MenuContextMenuToolBar 類別。 焦點範圍的項目已 IsFocusScope 設定為 true

如需焦點、鍵盤焦點和邏輯焦點的詳細資訊,請參閱 輸入概觀

相依性屬性資訊

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

適用於

產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9