AutomationProperties.HeadingLevel 附加屬性

定義

取得或設定 UI 自動化專案的標題層級。

see GetHeadingLevel, and SetHeadingLevel
see GetHeadingLevel, and SetHeadingLevel
see GetHeadingLevel, and SetHeadingLevel

Windows 需求

裝置系列
Windows 10, version 1803 (已於 10.0.17134.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v6.0 引進)

範例

<TextBlock
    Text="Mouse Options"
    AutomationProperties.HeadingLevel="1"/>
</TextBlock>

<StackPanel AutomationProperties.AutomationName="Description of Content"  AutomationProperties.HeadingLevel="1">
    <!-- content here -->
</StackPanel>
public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();

        AutomationProperties.SetHeadingLevel(this, AutomationHeadingLevel.HeadingLevel3);
    }
}

備註

標題元素會組織使用者介面,並讓您更容易流覽。 某些輔助技術 (AT) 可讓使用者快速跳到標題之間。 標題的層級從 1 到 9。

標題層級屬性值是由 GetHeadingLevel 方法傳回。