I have an enum with various values:
public enum UserStatus
{
Active = 1,
Inactive = 2,
Invalid = 3,
Blocked = 4,
Pending = 5
}
And on my UI I'm assigning a color for each value of the enum, and since it's used in various windows, I've created a Converter for it.
Now I want to display a legend of some of the enum values, is there anyway I can bind a static enum value to a property in a WPF control?
<!-- I want ? to be a fixed enum value -->
<TextBlock Text="{Binding ?, Converter={StaticResource=UserStatusToString}}" Foreground={Binding ?, Converter={StaticResource=UserStatusToBrush}} />
I don't have a data object at this point and I only want to somehow pick the color value from the converter instead of hard-typing it in the legend. Is there anyway I can do this?