I'm some application and i would like to bind some textboxes and chekcboxes to value field of Dictionary(Enum, string). Is this possible and how can I do that?
In xaml code I have something like this - it is working for Dictionary with string as a key, but it cannot correctly bind to key with enum
<dxe:TextEdit EditValue="{Binding Properties[PrimaryAddress], Mode=TwoWay}" />
<dxe:TextEdit EditValue="{Binding Properties[SecondaryAddress], Mode=TwoWay}" />
<dxe:CheckEdit EditValue="{Binding Properties[UsePrimaryAddress], Mode=TwoWay}" />
.. and here is what I have in Enum
public enum MyEnum
{
PrimaryAddress,
SecondaryAddress,
UsePrimaryAddress
}
In ViewModel dictionary is defined as:
public Dictionary<MyEnum, string> Properties
I have found solution for combobox with enum values but this does not apply to my case.
Any advice?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…