I\'ve got a very similar question to Jinesh\'s. I need to get the value of the SelectedIndex (or SelectedItem or SelectedValue) of a combo box in to my ViewMode
The property getter ignores the previously set value and always returns the index of the current month.
The declaration should look like this:
private int monthIndex = DateTime.Today.Month - 1;
public int MonthIndex
{
get { return monthIndex; }
set
{
if (monthIndex != value)
{
monthIndex = value;
RaisePropertyChanged("MonthIndex");
}
}
}