示例#1
0
        private static void OnSetCommandCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            NumericUpDown element = dependencyObject as NumericUpDown;

            if (element != null)
            {
                NumericUpDownValueChangedBehavior behavior = GetOrCreateBehavior(element);
                behavior.Command = e.NewValue as ICommand;
            }
        }
示例#2
0
        private static NumericUpDownValueChangedBehavior GetOrCreateBehavior(NumericUpDown element)
        {
            NumericUpDownValueChangedBehavior behavior = element.GetValue(keyUpCommandBehaviorProperty) as NumericUpDownValueChangedBehavior;

            if (behavior == null)
            {
                behavior = new NumericUpDownValueChangedBehavior(element);
                element.SetValue(keyUpCommandBehaviorProperty, behavior);
            }

            return(behavior);
        }
示例#3
0
 private static void SetkeyUpCommandBehavior(DependencyObject dependencyObject, NumericUpDownValueChangedBehavior value)
 {
     dependencyObject.SetValue(keyUpCommandBehaviorProperty, value);
 }