예제 #1
0
        void OnTemperatureOptionPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            OptionViewModel <Temperature> option = sender as OptionViewModel <Temperature>;

            if (option.IsSelected)
            {
                this.CupOfCoffee.Temperature = option.GetValue();
            }
        }
예제 #2
0
        void OnDrinkSizeOptionPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            OptionViewModel <DrinkSize> option = sender as OptionViewModel <DrinkSize>;

            if (option.IsSelected)
            {
                this.CupOfCoffee.DrinkSize = option.GetValue();
            }
        }
예제 #3
0
        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);
            }
        }