Class Command

Definition

Namespace:
Tizen.NUI.Binding
Assembly:
Tizen.NUI.dll

Defines an ICommand implementation that wraps a Action.

C#
Copy
public class Command : ICommand
Inheritance
Command
Derived

Constructors

View Source

Command(Action)

Initializes a new instance of the Command class.

Declaration
C#
Copy
public Command(Action execute)
Parameters
Type Name Description
Action execute

An Action to execute when the Command is executed.

View Source

Command(Action, Func<Boolean>)

Initializes a new instance of the Command class.

Declaration
C#
Copy
public Command(Action execute, Func<bool> canExecute)
Parameters
Type Name Description
Action execute

An Action to execute when the Command is executed.

Func<Boolean> canExecute

A instance indicating if the Command can be executed.

View Source

Command(Action<Object>)

Initializes a new instance of the Command class.

Declaration
C#
Copy
public Command(Action<object> execute)
Parameters
Type Name Description
Action<Object> execute

An instance to execute when the Command is executed.

View Source

Command(Action<Object>, Func<Object, Boolean>)

Initializes a new instance of the Command class.

Declaration
C#
Copy
public Command(Action<object> execute, Func<object, bool> canExecute)
Parameters
Type Name Description
Action<Object> execute

An Action to execute when the Command is executed.

Func<Object, Boolean> canExecute

A instance indicating if the Command can be executed.

Methods

View Source

CanExecute(Object)

Returns a Boolean indicating if the Command can be executed with the given parameter.

Declaration
C#
Copy
public bool CanExecute(object parameter)
Parameters
Type Name Description
Object parameter

An Object used as parameter to determine if the Command can be executed.

Returns
Type Description
Boolean

true if the Command can be executed, false otherwise.

View Source

ChangeCanExecute()

Send a CanExecuteChanged.

Declaration
C#
Copy
public void ChangeCanExecute()
View Source

Execute(Object)

Invokes the execute Action.

Declaration
C#
Copy
public void Execute(object parameter)
Parameters
Type Name Description
Object parameter

An Object used as parameter for the execute Action.

Events

View Source

CanExecuteChanged

Occurs when the target of the Command should reevaluate whether or not the Command can be executed.

Declaration
C#
Copy
public event EventHandler CanExecuteChanged
Event Type
Type Description
EventHandler

Extension Methods