Exemple #1
0
        private static void OnSetCommandCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            Control element = dependencyObject as Control;

            if (element != null)
            {
                keyUpBehavior behavior = GetOrCreateBehavior(element);
                behavior.Command = e.NewValue as ICommand;
            }
        }
Exemple #2
0
        private static keyUpBehavior GetOrCreateBehavior(Control element)
        {
            keyUpBehavior behavior = element.GetValue(keyUpCommandBehaviorProperty) as keyUpBehavior;

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

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