# RelayCommand<T> class

Namespace: [Eto.Forms](https://eto.picoe.ca/api/namespace/eto.forms.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
public class RelayCommand<T> : ICommand
```

Command to relay execution and execute state to delegates

**Type parameters:**

- `T`

**Derived types:** [RelayCommand](https://eto.picoe.ca/api/type/eto.forms.relaycommand.md), [RelayValueCommand<TParameter, TValue>](https://eto.picoe.ca/api/type/eto.forms.relayvaluecommand-2.md)

## Constructors

- [RelayCommand<T>](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/ctor.md): (2 overloads) Initializes a new instance of the [RelayCommand<T>](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1.md) class.

## Methods

- [CanExecute](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/canexecute.md): Determines whether this command can execute with the specified parameter.
- [Execute](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/execute.md): Executes the command with the specified parameter.
- [OnCanExecuteChanged](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/oncanexecutechanged.md): Raises the [RelayCommand<T>.CanExecuteChanged](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/canexecutechanged.md) event.
- [UpdateCanExecute](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/updatecanexecute.md): Tells consumers of this command that the [RelayCommand<T>.CanExecute(object)](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/canexecute.md) state has changed and should be queried again.

## Events

- [CanExecuteChanged](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/canexecutechanged.md): Occurs when the return value of [RelayCommand<T>.CanExecute(object)](https://eto.picoe.ca/api/type/eto.forms.relaycommand-1/canexecute.md) is changed.
