私は辞書を持っています
public class TAGs :INotifyPropertyChanged{
private Dictionary<string, string[]> _items = new Dictionary<string,string[]>();
...............
public string[] Keys
{
get { return Items.Keys.ToArray(); }
}
}
キー用の 1 つのリストと、選択したキーの値を含むもう 1 つのリストの 2 つのリストを作成したいのですが、これを試してみましたが、うまくいきません
<ListBox x:Name="TagNameList" ItemsSource="{Binding Keys}"/>
<ListBox ItemsSource="{Binding Items[{Binding SelectedItem,ElementName=TagNameList}]}"/>
私はそれらをグリッドに含め、それらのデータコンテキストはタグのオブジェクトです。最初のリストボックスはプロパティへの単純なバインドとして正常に機能していますが、2 番目のリストは役に立ちませんか?