示例#1
0
        private static void maxValueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DoubleUpDownWithNull numericUpDown = ((DoubleUpDownWithNull)d);

            numericUpDown.CoerceValue(MinValueProperty);
            numericUpDown.CoerceValue(ValueProperty);
        }
示例#2
0
        private static void valueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DoubleUpDownWithNull          numericUpDown = (DoubleUpDownWithNull)d;
            ValueChangedWithNullEventArgs ea            =
                new ValueChangedWithNullEventArgs(DoubleUpDownWithNull.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 == null ? string.Empty : e.NewValue.ToString();
        }
示例#3
0
        private static object coerceIncrementCallback(DependencyObject d, object value)
        {
            DoubleUpDownWithNull numericUpDown = ((DoubleUpDownWithNull)d);
            double i = numericUpDown.MaxValue - numericUpDown.MinValue;

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

            return(value);
        }