Say I wanna bind to dictionary that TKey is string with XAML:
<Label DataContext="{MyDictionary}" Content="{Binding Item("OK")}" />
Doesn't work.
How should I do it?
I am talking about the Item("Key")
Try that :
<Label DataContext="{Binding MyDictionary}" Content="{Binding [OK]}" />
Or that (a bit simpler) :
<Label Content="{Binding MyDictionary[OK]}" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With