I'm trying to bind an enum to a radio button in WPF (Inspired by this answer), but I have trouble finding the enum type for the converter parameter:
The enum is defined in the following way
namespace Application.Models
{
public class Enums
{
public enum MySelections { one, two ,three };
public MySelections CurrentSelection;
...
}
}
I am trying to bind now the checkbox like this (The data context is assumed to be correct and the value converter implemented:)
<Window x:Class="Application.MainWindow"
....
xnlns:models="clr-namespace:Application.Models" >
...
<RadioButton Content="One"
IsChecked="{Binding Path=CurrentSelection, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static models:Enums.MySelections.one}}" />
...
The problem lies with {x:Static models:Enums.MySelections.one}
which constantly throws the error that the type models:Enums.MySelections
could not be found.
How can I find my enum type?
Enum
class from the bind? – Scatology