I have a listbox bound to a view model observable collection:
This works fine, minus one little hitch… assuming that the observable collection contains strings, the whole thing breaks down when entries with identical values get added to the collection, what is the best way to handle this? Custom struct instead of strings and then a datatemplate?
edit: completely forgot to explain the behavior… it selects multiple values when i click on a single entry, all other values with the same text get selected.
This problem exists because its the nature of the Selector derived control. When you start to select an item from the ObservableCollection type and your collection contains duplicate strings, the selector is confused as to which item it has selected. You need to create a new simple class/struct and put your string in there.
and like so.