Esempio n. 1
0
        private static void UnhookCommand(ButtonBase element, ICommand command)
        {
            CommandButtonBehavior behavior = (CommandButtonBehavior)element.GetValue(CommandButtonBehaviorProperty);

            behavior.Dettach();
            element.ClearValue(CommandButtonBehaviorProperty);
        }
Esempio n. 2
0
        private static void HookCommand(ButtonBase element, ICommand command)
        {
            var behavior = new CommandButtonBehavior(element, command);

            behavior.Attach();
            element.SetValue(CommandButtonBehaviorProperty, behavior);
        }
Esempio n. 3
0
 private static void HookCommand(ButtonBase element, ICommand command)
 {
     CommandButtonBehavior behavior = new CommandButtonBehavior(element, command);
     behavior.Attach();
     element.SetValue(CommandButtonBehaviorProperty, behavior);
 }