private static void SetBehavior(DependencyObject d, CommandBehaviorBinding value) { d.SetValue(BehaviorProperty, value); }
private static CommandBehaviorBinding FetchOrCreateBinding(DependencyObject d) { CommandBehaviorBinding binding = CommandBehavior.GetBehavior(d); if (binding == null) { binding = new CommandBehaviorBinding(); CommandBehavior.SetBehavior(d, binding); } return binding; }