public partial class ViewModel_AC: INotifyPropertyChanged
ICommand _chkGridTop;
public ICommand Chk_GridTop
get { return _chkGridTop ?? (_chkGridTop = new DelegateCommand(_chk_GridTop)); }
public void _chk_GridTop(object check)
//Empty
}
DelegateCommand
public class DelegateCommand : ICommand
readonly Action<object> _execute;
readonly Predicate<object> _canExecute;
public DelegateCommand(Action<object> execute, Predicate<object> canExecute)
if (execute == null)
throw new NullReferenceException("execute can no null");
_execute = execute;
_canExecute = canExecute;
public DelegateCommand(Action<object> execute) : this(execute, null)
public event EventHandler CanExecuteChanged
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
public bool CanExecute(object parameter)
return _canExecute == null ? true : _canExecute(parameter);
public void Execute(object parameter)