Bagikan melalui


RadioMenuFlyoutItem.AreCheckStatesEnabledProperty Properti

Definisi

Mengidentifikasi properti dependensi AreCheckStatesEnabled . Mewakili apakah MenuFlyoutSubItem memiliki RadioMenuFlyoutItems sebagai turunan.

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; }
var dependencyProperty = RadioMenuFlyoutItem.areCheckStatesEnabledProperty;
Public Shared ReadOnly Property AreCheckStatesEnabledProperty As DependencyProperty

Nilai Properti

Pengidentifikasi untuk properti dependensi AreCheckStatesEnabled .

Atribut
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodNameAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Contoh

Dalam contoh berikut, CommandBar memiliki tombol "Urutkan Menurut" yang mencantumkan opsi pengurutan di MenuFlyout. MenuFlyout ini memiliki sub menu "Lainnya" yang berisi RadioMenuFlyoutItems. Saat salah satu item tersebut dipilih, sub menu "Lainnya" juga menampilkan visual pilihan.

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

Menu dengan RadioMenuFlyoutItems

Keterangan

Properti ini hanya boleh digunakan bersama dengan MenuFlyoutSubItem yang menerapkannya RadioMenuFlyoutSubItemStyle . RadioMenuFlyoutSubItemStyle Karena secara otomatis mengatur properti ini ke true, properti ini tidak perlu diatur secara manual.

Saat menggunakan objek RadioMenuFlyoutItem sebagai turunan dari MenuFlyoutSubItem, Anda harus mengatur gaya MenuFlyoutSubItem ke RadioMenuFlyoutSubItemStyle. Ini akan diatur AreCheckStatesEnabled ke true dan memastikan bahwa ketika salah satu RadioMenuFlyoutItems turunannya dipilih, MenuFlyoutSubItem juga akan menampilkan indikator pemeriksaan visual.

Jika anak RadioMenuFlyoutItem dipilih dan MenuFlyout terbuka, induk dan turunan akan menampilkan indikator pilihan.

Berlaku untuk

Lihat juga