Поделиться через


RadioMenuFlyoutItem.AreCheckStatesEnabledProperty Свойство

Определение

Определяет свойство зависимости AreCheckStatesEnabled.

Эта документация относится к WinUI 2 для UWP (для WinUI в Windows App SDK см. Windows App 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

Значение свойства

Идентификатор свойства зависимости AreCheckStatesEnabled. (Не поддерживается.)

Атрибуты
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodNameAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Примеры

В следующем примере commandBar имеет кнопку "Сортировать по", которая выводит список параметров сортировки в MenuFlyout. В этом меню MenuFlyout есть подменю "Другое", содержащее RadioMenuFlyoutItems. При выборе одного из этих элементов в подменю "Другое" также отображается визуальный элемент выбора.

<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.

Это свойство следует использовать только в сочетании с MenuFlyoutSubItem, RadioMenuFlyoutSubItemStyle к которому применен объект . RadioMenuFlyoutSubItemStyle Так как автоматически присваивает этому свойству значение true, это свойство не нужно задавать вручную.

При использовании объектов RadioMenuFlyoutItem в качестве дочерних элементов Элемента MenuFlyoutSubItem следует задать для стиля MenuFlyoutSubItem значение RadioMenuFlyoutSubItemStyle. При этом будет задано AreCheckStatesEnabled значение true и гарантируется, что при выборе любого из дочерних элементов RadioMenuFlyoutItem элемент MenuFlyoutSubItem также будет отображать визуальный контрольный индикатор.

Если выбран дочерний элемент RadioMenuFlyoutItem и открыт элемент MenuFlyout, индикатор выбора будет отображаться как родительским, так и дочерним элементам.

Применяется к