I have a WPF MVVM application. In the View I have a multiselect ListBox
. In the ViewModel I have a property for the selected items in the List.
Using a technique similar to the one in the answer to this question I can bind my property to the ListBox
.
But I also want to do data validation via IDataErrorInfo
. All I want to do is check that the user has selected at least one item in the list. Adding ValidatesOnDataErrors=True
to the binding doesn't work.
Is there any way to have a multiselect listbox that's databound with IDataErrorInfo?