public enum Type
{
One = 1,
Two = 2,
Three = 3
}
public void Method()
{
Type type = Type.One;
var binding = new Binding(type - ???);
binding.Converter = ?????;
var child = new FrameworkElementFactory(typeof(ComboBox));
child.SetValue(ComboBox.ItemsSourceProperty, Enum.GetValues(typeof(Type)));
child.SetValue(ComboBox.SelectedValueProperty, binding);
}
I want to bind type
to XAML in the code. But I don't know how I can right to do it. And I don't know the converter (Enum<->String) name. I only know it's the standard converter.
Questions:
- How can I right to do it?
- Where can I find the list of all standard converters?