Class RelayCommand
A _command whose sole purpose is to relay its functionality to other objects by invoking delegates. The default return value for the CanExecute(Nullable<Object>) method is true. This type does not allow you to accept _command parameters in the Execute(Nullable<Object>) and CanExecute(Nullable<Object>) callback methods.
Inheritance
System.Object
RelayCommand
Namespace: ISynergy.Framework.Mvvm.Commands
Assembly: ISynergy.Framework.Mvvm.dll
Syntax
public sealed class RelayCommand : object, IRelayCommand
Constructors
View SourceRelayCommand(Action)
Initializes a new instance of the RelayCommand class that can always _execute.
Declaration
public RelayCommand(Action execute)
Parameters
Type | Name | Description |
---|---|---|
Action | execute | The execution logic. |
RelayCommand(Action, Func<Boolean>)
Initializes a new instance of the RelayCommand class.
Declaration
public RelayCommand(Action execute, Func<bool> canExecute)
Parameters
Type | Name | Description |
---|---|---|
Action | execute | The execution logic. |
Func<System.Boolean> | canExecute | The execution status logic. |
Methods
View SourceCanExecute(Nullable<Object>)
Declaration
public bool CanExecute(object? parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | parameter |
Returns
Type | Description |
---|---|
System.Boolean |
Execute(Nullable<Object>)
Declaration
public void Execute(object? parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | parameter |
NotifyCanExecuteChanged()
Notifies that the
Declaration
public void NotifyCanExecuteChanged()
Events
View SourceCanExecuteChanged
Declaration
public event EventHandler? CanExecuteChanged
Event Type
Type | Description |
---|---|
System.Nullable<EventHandler> |
Implements
ICommand