示例#1
0
 /// <summary>
 /// Sets the behaviour property.  
 /// </summary>
 private static void Setbehaviour(DependencyObject d, CommandBehaviourBinding value)
 {
     d.SetValue(behaviourProperty, value);
 }
示例#2
0
 //tries to get a CommandBehaviourBinding from the element. Creates a new instance if there is not one attached
 private static CommandBehaviourBinding FetchOrCreateBinding(DependencyObject d)
 {
     CommandBehaviourBinding binding = CommandBehaviour.Getbehaviour(d);
     if (binding == null)
     {
         binding = new CommandBehaviourBinding();
         CommandBehaviour.Setbehaviour(d, binding);
     }
     return binding;
 }