Skip to content

RafaelSalguero/EnumSourceConverter

Repository files navigation

EnumSourceConverter

Directly bind items controls to enum properties

#Nuget:

Install-Package Tonic.UI.EnumSource

#Usage Add enum type properties to your view model:

public enum Animal
{
    Dog,
    Cat,
    [Description("Danger noodle")]
    Snake
}
public class ViewModel
{
    public Animal? PetType { get; set; }
}

Bind items controls to that property:

...
xmlns:ui="http://toniccomputing.com/patterns/ui"
...
<ComboBox ItemsSource="{ui:EnumSource PetType}" SelectedItem="{ui:EnumBinding PetType}" />

About

Directly bind items controls to enum properties

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages