Class NotifyCommand
public abstract class NotifyCommand : NotifyPropertyChangedBase, INotifyPropertyChanged, ICommand
- Inheritance
-
NotifyCommand
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
NotifyCommand(Action<object>)
执行命令
public NotifyCommand(Action<object> action)
Parameters
NotifyCommand(Action<object>, Predicate<object>)
执行命令
public NotifyCommand(Action<object> execute, Predicate<object> canExecute)
Parameters
Fields
_action
protected Action<object> _action
Field Value
_canExecute
protected readonly Predicate<object> _canExecute
Field Value
Methods
CanExecute(object)
命令是否可执行
public virtual bool CanExecute(object parameter)
Parameters
parameter
object
Returns
Execute(object)
执行命令
public virtual void Execute(object parameter)
Parameters
parameter
object
Refresh()
刷新命令可执行状态 (会调用CanExecute方法)
public void Refresh()
Events
CanExecuteChanged
Occurs when changes occur that affect whether or not the command should execute.
public event EventHandler CanExecuteChanged