/// <summary> /// Initializes a new instance of the <see cref="CommandBinding"/> class. /// </summary> /// <param name="command">The command that is being bound.</param> /// <param name="executed">The handler for the command's <see cref="Executed"/> event.</param> /// <param name="canExecute">The handler for the command's <see cref="CanExecute"/> event.</param> public CommandBinding(ICommand command, UpfExecutedRoutedEventHandler executed, UpfCanExecuteRoutedEventHandler canExecute) { Contract.Require(command, nameof(command)); this.command = command; if (executed != null) { Executed += executed; } if (canExecute != null) { CanExecute += canExecute; } }
/// <summary> /// Initializes a new instance of the <see cref="CommandBinding"/> class. /// </summary> /// <param name="command">The command that is being bound.</param> /// <param name="executed">The handler for the command's <see cref="Executed"/> event.</param> public CommandBinding(ICommand command, UpfExecutedRoutedEventHandler executed) : this(command, executed, null) { }