Ghost1372

everything can be handy

EnumValuesExtension

Assuming we had an Animal enum type and we wanted the user to pick one of the available names, here is the XAML syntax that allows us to create a ComboBox and display all Animal values, directly from XAML and with no code-behind:

1
2
3
4
5
6
<ComboBox
xmlns:dev="using:DevWinUI"
xmlns:enums="using:MyApplication.Enums"
ItemsSource="{dev:EnumValues Type=enums:Animal}"
SelectedIndex="0"/>

DevWinUI

Demo

you can run demo and see this feature.

0%