private static ClickedBehavior GetOrCreateBehavior(ButtonBase element) { var behavior = element.GetValue(ClickedBehaviorProperty) as ClickedBehavior; if (behavior == null) { behavior = new ClickedBehavior(element); element.SetValue(ClickedBehaviorProperty, behavior); } return(behavior); }
public static void SetClickedBehavior(DependencyObject obj, ClickedBehavior value) { obj.SetValue(ClickedBehaviorProperty, value); }