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.
Dokumentasi ini berlaku untuk WinUI 2 untuk UWP (untuk WinUI di SDK Aplikasi Windows, lihat namespace SDK Aplikasi Windows).
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
Nilai Properti
Pengidentifikasi untuk properti dependensi AreCheckStatesEnabled. (Tidak didukung.)
- 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. Ketika salah satu item tersebut dipilih, sub menu "Lainnya" juga menunjukkan 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
Mewakili apakah MenuFlyoutSubItem memiliki RadioMenuFlyoutItems sebagai turunan.
Properti ini hanya boleh digunakan bersama dengan MenuFlyoutSubItem yang RadioMenuFlyoutSubItemStyle
menerapkannya. 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 memperlihatkan indikator pilihan.
Berlaku untuk
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