RadioMenuFlyoutItem.AreCheckStatesEnabledProperty Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
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>
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
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk