I want to stop the ComboBox_SelectionChanged event from being fired at the UI loading. It should happen only when the user makes some change in the combo box.
To do this, I have written the following in .xam.cs file.
private void myComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ComboBox cb = (ComboBox)sender;
if (!cb.IsFocused)
{
return;
}
else
ViewModel.OnPropertyChanged("MyProperty");
}
But this does not even fire the event when the user makes the change. Where have I gone wrong ?
I know there is a similar question in stackoverflow. But the solutions in it did not work for me. pls help.