Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 private void OnCommandParameterChanged(CommandTriggerAction commandTriggerAction, AvaloniaPropertyChangedEventArgs e)
 {
     commandTriggerAction.EnableDisableElement();
 }