I have a combobox bound to an Observable Collection which works fine. On page load the selected item of the Combobox is not set. The user can then select an item from the Combobox.
However, I want to be able to deselect the selected item on a button click. Is there any way to do this with the MVVM pattern? I don't really want to insert a NULL item at the start of my Observable Collection.
So far I've achieved this by breaking the MVVM pattern with a button click event in the view's code behind...
private void ClearPublicationsButton_Click(object sender, RoutedEventArgs e)
{
comboBox1.SelectedItem = null;
}
Thanks