Shi*_*mmy 4 vb.net wpf xaml dictionary idictionary
假设我想绑定到TKey与XAML字符串的字典:
<Label DataContext="{MyDictionary}" Content="{Binding Item("OK")}" />
Run Code Online (Sandbox Code Playgroud)
不行.
我该怎么办?
我说的是物品("钥匙")
Tho*_*que 12
试试看:
<Label DataContext="{Binding MyDictionary}" Content="{Binding [OK]}" />
Run Code Online (Sandbox Code Playgroud)
或者那(更简单):
<Label Content="{Binding MyDictionary[OK]}" />
Run Code Online (Sandbox Code Playgroud)