示例#1
0
        //PropertyChangedBase _parent;

        public ButtonCommand(PropertyChangedBase parent, Action ExeAction, Func <bool> CanExecuteCondition)
        {
            _action                 = ExeAction;
            _condition              = CanExecuteCondition;
            parent.PropertyChanged += delegate { CanExecuteChanged?.Invoke(this, EventArgs.Empty); };
        }
示例#2
0
 public AsyncCommand(PropertyChangedBase parent, Func <Task> command, Func <bool> CanExecuteCondition)
 {
     _command                = command;
     _condition              = CanExecuteCondition;
     parent.PropertyChanged += delegate { CanExecuteChanged?.Invoke(this, EventArgs.Empty); };
 }