Ejemplo n.º 1
0
        //tries to get a CommandBehaviorBinding from the element. Creates a new instance if there is not one attached
        private static EventCommandBehaviorBinding FetchOrCreateBinding(DependencyObject d)
        {
            var binding = GetBehavior(d);

            if (binding == null)
            {
                binding = new EventCommandBehaviorBinding();
                SetBehavior(d, binding);
            }
            return(binding);
        }
Ejemplo n.º 2
0
 /// <summary> Sets the Behavior property.
 /// </summary>
 private static void SetBehavior(DependencyObject d, EventCommandBehaviorBinding value)
 {
     d.SetValue(BehaviorProperty, value);
 }