I have a Listbox that is binded to a Dictionary.
The dictionary contains a keyword and a string.
<ListBox Style="{StaticResource ListBoxStyle}" ItemsSource="{Binding PatientImgResources, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding SelectedKey}" DisplayMemberPath="Key" />
PatientImgResources is the Dictionary
SelectedKey is the Value I want,
DisplayMemberPath just shows the keyword.
I want this keyword as my value, unfortunately SelectedKey always contains the whole dictionary entry, keyword plus value.
I tried SelectedValuePath=”Key” . didn’t work so far.
Is it possible to bind to the key? I don’t want to use stripped dictionaries.
in ItemSource Binding use “PatientImgResources.Keys” instead of “PatientImgResources”…