Class InvokeCommand
public class InvokeCommand : INotifyPropertyChanged, IInvokeCommand, ICommand- Inheritance
- 
      
      InvokeCommand
- Implements
- Inherited Members
- Extension Methods
Constructors
InvokeCommand(Action<IInvokeCommand, object>)
public InvokeCommand(Action<IInvokeCommand, object> action)Parameters
- actionAction<IInvokeCommand, object>
InvokeCommand(Action<IInvokeCommand, object>, Func<IInvokeCommand, object, bool>)
public InvokeCommand(Action<IInvokeCommand, object> execute, Func<IInvokeCommand, object, bool> canExecute)Parameters
- executeAction<IInvokeCommand, object>
- canExecuteFunc<IInvokeCommand, object, bool>
InvokeCommand(Action<object>)
public InvokeCommand(Action<object> action)Parameters
InvokeCommand(Action<object>, Predicate<object>)
public InvokeCommand(Action<object> execute, Predicate<object> canExecute)Parameters
Fields
_action
protected Action<object> _actionField Value
_actionCommand
protected Action<IInvokeCommand, object> _actionCommandField Value
_canExecute
protected readonly Predicate<object> _canExecuteField Value
_canExecuteCommand
protected readonly Func<IInvokeCommand, object, bool> _canExecuteCommandField Value
Properties
GroupName
[JsonIgnore]
[Browsable(false)]
public string GroupName { get; set; }Property Value
IsBusy
public bool IsBusy { get; set; }Property Value
IsEnabled
public bool IsEnabled { get; set; }Property Value
IsIndeterminate
public bool IsIndeterminate { get; set; }Property Value
IsVisible
public bool IsVisible { get; set; }Property Value
Message
public string Message { get; set; }Property Value
Name
public string Name { get; set; }Property Value
Percent
public double Percent { get; set; }Property Value
Methods
CanExecute(object)
Defines the method that determines whether the command can execute in its current state.
public bool CanExecute(object parameter)Parameters
- parameterobject
- Data used by the command. If the command does not require data to be passed, this object can be set to null. 
Returns
Execute(object)
执行命令
public virtual void Execute(object parameter)Parameters
- parameterobject
RaisePropertyChanged(string)
public void RaisePropertyChanged(string propertyName = "")Parameters
- propertyNamestring
Refresh()
刷新命令可执行状态 (会调用CanExecute方法)
public void Refresh()Events
CanExecuteChanged
Occurs when changes occur that affect whether or not the command should execute.
public event EventHandler CanExecuteChangedEvent Type
PropertyChanged
Occurs when a property value changes.
public event PropertyChangedEventHandler PropertyChangedEvent Type
Operators
implicit operator InvokeCommand(Action<IInvokeCommand, object>)
public static implicit operator InvokeCommand(Action<IInvokeCommand, object> action)Parameters
- actionAction<IInvokeCommand, object>
Returns
implicit operator InvokeCommand(Action<object>)
public static implicit operator InvokeCommand(Action<object> action)