Table of Contents

Class RelayCommand<T>

Namespace
HeBianGu.Base.WpfBase
Assembly
HeBianGu.Base.WpfBase.dll
public class RelayCommand<T> : ICommand

Type Parameters

T
Inheritance
RelayCommand<T>
Implements
Inherited Members
Extension Methods

Constructors

RelayCommand(Action<T>)

public RelayCommand(Action<T> executeCommand)

Parameters

executeCommand Action<T>

RelayCommand(Action<T>, Predicate<T>)

public RelayCommand(Action<T> executeCommand, Predicate<T> canExecuteCommand)

Parameters

executeCommand Action<T>
canExecuteCommand Predicate<T>

Properties

CanExecuteCommand

public Predicate<T> CanExecuteCommand { get; }

Property Value

Predicate<T>

ExecuteCommand

public Action<T> ExecuteCommand { get; }

Property Value

Action<T>

Methods

CanExecute(object)

Defines the method that determines whether the command can execute in its current state.

public bool CanExecute(object parameter)

Parameters

parameter object

Data used by the command. If the command does not require data to be passed, this object can be set to null.

Returns

bool

true if this command can be executed; otherwise, false.

Execute(object)

Defines the method to be called when the command is invoked.

public void Execute(object parameter)

Parameters

parameter object

Data used by the command. If the command does not require data to be passed, this object can be set to null.

Events

CanExecuteChanged

Occurs when changes occur that affect whether or not the command should execute.

public event EventHandler CanExecuteChanged

Event Type

EventHandler