Exemplo n.º 1
0
        private static void OnCommandChanged(DependencyObject o, DependencyPropertyChangedEventArgs args)
        {
            CommandButton me = o as CommandButton;

            ICommand oldCommand = (ICommand)args.OldValue;
            ICommand newCommand = (ICommand)args.NewValue;

            me.RewireCommand(oldCommand, newCommand);

            if (newCommand != null)
            {
                me.IsEnabled = newCommand.CanExecute(me.CommandParameter);
            }
        }
Exemplo n.º 2
0
 private static void OnCommandParameterChanged(DependencyObject o, DependencyPropertyChangedEventArgs args)
 {
     CommandButton me = o as CommandButton;
 }