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); } }
private static void OnCommandParameterChanged(DependencyObject o, DependencyPropertyChangedEventArgs args) { CommandButton me = o as CommandButton; }