CommandBindingsCollectionAdd(ActionICommandState, IDictionaryString, Object) Method

Creates a binding with an internally created disposable SimpleCommand for the specified callback without any sources and targets. At least one source must be added by the ICommandBinding.AddSource method to make the command invokable. The created binding will be added to this CommandBindingsCollection.

Definition

Namespace: KGySoft.ComponentModel
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public ICommandBinding Add(
	Action<ICommandState> callback,
	IDictionary<string, Object?>? initialState = null
)

Parameters

callback  ActionICommandState
The delegate to create the command from.
initialState  IDictionaryString, Object  (Optional)
The initial state of the binding. This parameter is optional.
Default value: .

Return Value

ICommandBinding
An ICommandBinding instance, whose State is initialized by the provided initialState. To make the command invokable by this binding, at least one source must be added by the AddSource method on the result.

See Also