私のコンボボックスアイテムの名前と値を私のリストから取得したいのですが、私はビューモデルにコンボボックスアイテムリストを保持させたくありません。WPF/C# - バインディングリスト<string> to combobox
私は、リストA、B、C、D
public List<String> ComboList { get; set; }
...
ComboList = new List<String>();
ComboList.Add("A");
ComboList.Add("B");
ComboList.Add("C");
ComboList.Add("D");
と私のコンボボックス
<ComboBox Margin="29,40,0,526" Width="212" Height="35" Grid.Row="1" ItemsSource="{Binding Path=ComboList, Mode=OneTime}" SelectedValuePath="Key" DisplayMemberPath="Value"></ComboBox>
を得たが、それは私に空を与えますコンボボックス...
どこからキー/値を取得していますか?これは辞書であり、リストではないのですか? – scottheckel
オハイオ州のたわごと、thatsの問題 – David
hehe、ええ、それは常に最も頭痛を引き起こす明らかなものです。 – scottheckel