Share via


RadioMenuFlyoutItem.AreCheckStatesEnabledProperty 屬性

定義

識別 IsCheckStatesEnabled 相依性屬性。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

public:
 static property DependencyProperty ^ AreCheckStatesEnabledProperty { DependencyProperty ^ get(); };
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnAreCheckStatesEnabledPropertyChanged")]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnAreCheckStatesEnabledPropertyChanged")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
static DependencyProperty AreCheckStatesEnabledProperty();
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnAreCheckStatesEnabledPropertyChanged")]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")]
public static DependencyProperty AreCheckStatesEnabledProperty { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnAreCheckStatesEnabledPropertyChanged")] [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="false")] get; }
Public Shared ReadOnly Property AreCheckStatesEnabledProperty As DependencyProperty

屬性值

IsCheckStatesEnabled 相依性屬性的識別碼。 (不支援。)

屬性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodNameAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

範例

在下列範例中,CommandBar 有一個 [排序依據] 按鈕,列出 MenuFlyout 中的排序選項。 此 MenuFlyout 具有包含 RadioMenuFlyoutItems 的 「Other」 子功能表。 選取其中一個專案時,[其他] 子功能表也會顯示選取範圍視覺效果。

<CommandBar DefaultLabelPosition="Right" Grid.Row="1" Margin="50">
    <AppBarToggleButton Icon="Shuffle" Label="Shuffle" />
    <AppBarToggleButton Icon="RepeatAll" Label="Repeat" />
    <AppBarSeparator/>
    <AppBarButton Icon="Back" />
    <AppBarButton Icon="Stop" />
    <AppBarButton Icon="Go" Label="Sort by">
        <AppBarButton.Flyout>
            <MenuFlyout>
                <RadioMenuFlyoutItem Text="Name" GroupName="SortGroup"/>
                <RadioMenuFlyoutItem Text="Date" GroupName="SortGroup"/>
                <RadioMenuFlyoutItem Text="Size" GroupName="SortGroup"/>
                <MenuFlyoutSubItem Text="Other" Style="{StaticResource RadioMenuFlyoutSubItemStyle}">
                    <RadioMenuFlyoutItem GroupName="SortGroup" Text="Album Name"/>
                    <RadioMenuFlyoutItem GroupName="SortGroup" Text="Artist Name"/>
                    <RadioMenuFlyoutItem GroupName="SortGroup" Text="Genre"/>
                </MenuFlyoutSubItem>
            </MenuFlyout>
        </AppBarButton.Flyout>
    </AppBarButton>

    <AppBarSeparator/>
    <AppBarButton Icon="Play" Label="Play" />
    <AppBarButton Icon="Forward" Label="Forward" />

    <CommandBar.SecondaryCommands>
        <AppBarButton Label="Like" />
        <AppBarButton Label="Dislike" />
    </CommandBar.SecondaryCommands>

</CommandBar>

具有 RadioMenuFlyoutItems 的功能表

備註

表示 MenuFlyoutSubItem 是否具有 RadioMenuFlyoutItems 做為子系。

此屬性應該只與已 RadioMenuFlyoutSubItemStyle 套用的 MenuFlyoutSubItem 搭配使用。 由於 會自動 RadioMenuFlyoutSubItemStyle 將此屬性設定為 true,因此不需要手動設定這個屬性。

使用 RadioMenuFlyoutItem 物件做為 MenuFlyoutSubItem 的子系時,您應該將 MenuFlyoutSubItem 樣式設定為 RadioMenuFlyoutSubItemStyle 。 這會設定 AreCheckStatesEnabled 為 true,並確保選取其任何子 RadioMenuFlyoutItems 時,MenuFlyoutSubItem 也會顯示視覺檢查指標。

如果已選取 RadioMenuFlyoutItem 子系且 MenuFlyout 已開啟,父項和子系都會顯示選取指標。

適用於