Exemple #1
0
        private static void maxValueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DoubleUpDown numericUpDown = ((DoubleUpDown)d);

            numericUpDown.CoerceValue(MinValueProperty);
            numericUpDown.CoerceValue(ValueProperty);
        }
Exemple #2
0
        private static void valueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DoubleUpDown          numericUpDown = (DoubleUpDown)d;
            ValueChangedEventArgs ea            =
                new ValueChangedEventArgs(DoubleUpDown.ValueChangedEvent, d, (double)e.OldValue, (double)e.NewValue);

            numericUpDown.RaiseEvent(ea);
            //if (ea.Handled) numericUpDown.Value = (double)e.OldValue;
            //else
            numericUpDown.PART_TextBox.Text = e.NewValue.ToString();
        }
Exemple #3
0
        private static object coerceIncrementCallback(DependencyObject d, object value)
        {
            DoubleUpDown numericUpDown = ((DoubleUpDown)d);
            double       i             = numericUpDown.MaxValue - numericUpDown.MinValue;

            if ((double)value > i)
            {
                return(i);
            }

            return(value);
        }