I am new to C# and MVVM, and I\'ve spent all day trying to get the value of a ComboBox to my ViewModel on SelectionChanged. I have managed to figure it
Why not do it the simpler way
In your ViewModel declare the combo box items and use a property "Source" to return it to the view
List _source = new List{"Item 1", "Item 2", "Item 3"};
public List Source
{
get { return _source; }
}
Then define one property which holds the selected item
string _theSelectedItem = null;
public string TheSelectedItem
{
get { return _theSelectedItem; }
set { _theSelectedItem = value; } // NotifyPropertyChanged
}
Also don't forget to implement the INotifyPropertyChanged interface while setting the _source