void OnTemperatureOptionPropertyChanged(object sender, PropertyChangedEventArgs e) { OptionViewModel <Temperature> option = sender as OptionViewModel <Temperature>; if (option.IsSelected) { this.CupOfCoffee.Temperature = option.GetValue(); } }
void OnDrinkSizeOptionPropertyChanged(object sender, PropertyChangedEventArgs e) { OptionViewModel <DrinkSize> option = sender as OptionViewModel <DrinkSize>; if (option.IsSelected) { this.CupOfCoffee.DrinkSize = option.GetValue(); } }
public int CompareTo(OptionViewModel <TValue> other) { if (other == null) { return(-1); } if (this.SortValue == UNSET_SORT_VALUE && other.SortValue == UNSET_SORT_VALUE) { return(this.DisplayName.CompareTo(other.DisplayName)); } else if (this.SortValue != UNSET_SORT_VALUE && other.SortValue != UNSET_SORT_VALUE) { return(this.SortValue.CompareTo(other.SortValue)); } else if (this.SortValue != UNSET_SORT_VALUE && other.SortValue == UNSET_SORT_VALUE) { return(-1); } else { return(+1); } }