Beispiel #1
0
        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;
        }
Beispiel #2
0
 public static ControlCommandBinder Bind(this Control control, ICommand command, IConfirmCommand confirm = null)
 {
     return(new ControlCommandBinder(control, command, confirm));
 }
Beispiel #3
0
 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),
     });
 }