Exemple #1
0
        private static object OnCoerceValue(DependencyObject d, object value)
        {
            if (!(value is double))
            {
                return(value);
            }
            NumberComboBox numberComboBox = (NumberComboBox)d;

            return((object)Math.Max(numberComboBox.Minimum, Math.Min((double)value, numberComboBox.Maximum)));
        }
Exemple #2
0
        private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumberComboBox numberComboBox = (NumberComboBox)d;

            if (numberComboBox.ValueChanged == null)
            {
                return;
            }
            numberComboBox.ValueChanged((object)numberComboBox, e);
        }