Table of Contents

Class NotifyCommand

Namespace
HeBianGu.Service.Command
Assembly
HeBianGu.Service.Command.dll
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

action Action<object>

NotifyCommand(Action<object>, Predicate<object>)

执行命令

public NotifyCommand(Action<object> execute, Predicate<object> canExecute)

Parameters

execute Action<object>
canExecute Predicate<object>

Fields

_action

protected Action<object> _action

Field Value

Action<object>

_canExecute

protected readonly Predicate<object> _canExecute

Field Value

Predicate<object>

Methods

CanExecute(object)

命令是否可执行

public virtual bool CanExecute(object parameter)

Parameters

parameter object

Returns

bool

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

Event Type

EventHandler