private void OnCommandChanged(CommandTriggerAction commandTriggerAction, AvaloniaPropertyChangedEventArgs e) { if (e.OldValue != null) { ((ICommand)e.OldValue).CanExecuteChanged -= commandTriggerAction.OnCommandCanExecuteChanged; } var command = (ICommand)e.NewValue; if (command != null) { command.CanExecuteChanged += commandTriggerAction.OnCommandCanExecuteChanged; } commandTriggerAction.EnableDisableElement(); }
private void OnCommandParameterChanged(CommandTriggerAction commandTriggerAction, AvaloniaPropertyChangedEventArgs e) { commandTriggerAction.EnableDisableElement(); }