public ControlCommandBinder(Control control, ICommand command, IConfirmCommand confirmCommand) { this.control = control; this.command = command; this.confirmCommand = confirmCommand; ReadCommandAsync(); command.CanExecuteChanged += command_CanExecuteChanged; control.Click += control_Click; control.Disposed += control_Disposed; }
public static ControlCommandBinder Bind(this Control control, ICommand command, IConfirmCommand confirm = null) { return(new ControlCommandBinder(control, command, confirm)); }
public static ControlCommandBinder[] Bind(this OKCancelButtons button, BaseAcceptableViewModel acceptable, IConfirmCommand cancel = null) { return(new[] { Bind(button.GetOK(), acceptable.Accept), Bind(button.GetCancel(), acceptable.Cancel, cancel), }); }