質問

TKeyがXAMLの文字列であることを辞書にバインドするとします:

<Label DataContext="{MyDictionary}" Content="{Binding Item("OK")}" />

動作しません。

どうすればいいですか?

Item(&quot; Key&quot;)について話している

役に立ちましたか?

解決

試してみてください:

<Label DataContext="{Binding MyDictionary}" Content="{Binding [OK]}" />

またはそれ(少し単純):

<Label Content="{Binding MyDictionary[OK]}" />
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top