Click or drag to resize

CommandDelegatedCommand Property

Gets or sets a command to delegate to when the command is invoked.

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
public ICommand DelegatedCommand { get; set; }

Property Value

Type: ICommand
The command to invoke.
This allows you to use a command to define menu/toolbar items or other functionality, and use a delegated command to chain to when invoked. This is especially useful when binding to a view model, you can do something like the following:
var myCommand = new Command { MenuText = "My Command", Parent = myForm };
myCommand.BindDataContext(c => c.DelegatedCommand, (MyModel m) => m.MyModelCommand);


myForm.DataContext = new MyModel { MyModelCommand = ... };
The CanExecute(Object) will also used to set the enabled/disabled state of the current command.
See Also