WinFormsCommandBindingsCollectionAdd(ICommand, IDictionaryString, Object, Boolean) Method
Creates a binding for a command without any sources and targets. At least one source must be added by the ICommandBinding.AddSource method to make the command invokable.
Targets can be added by the ICommandBinding.AddTarget method.
The created binding will be added to this CommandBindingsCollection.
Namespace: KGySoft.ComponentModelAssembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
public override ICommandBinding Add(
ICommand command,
IDictionary<string, Object?>? initialState = null,
bool disposeCommand = false
)
Public Overrides Function Add (
command As ICommand,
Optional initialState As IDictionary(Of String, Object) = Nothing,
Optional disposeCommand As Boolean = false
) As ICommandBinding
public:
virtual ICommandBinding^ Add(
ICommand^ command,
IDictionary<String^, Object^>^ initialState = nullptr,
bool disposeCommand = false
) override
abstract Add :
command : ICommand *
?initialState : IDictionary<string, Object> *
?disposeCommand : bool
(* Defaults:
let _initialState = defaultArg initialState null
let _disposeCommand = defaultArg disposeCommand false
*)
-> ICommandBinding
override Add :
command : ICommand *
?initialState : IDictionary<string, Object> *
?disposeCommand : bool
(* Defaults:
let _initialState = defaultArg initialState null
let _disposeCommand = defaultArg disposeCommand false
*)
-> ICommandBinding
- command ICommand
- The command to bind.
- initialState IDictionaryString, Object (Optional)
- The initial state of the binding. This parameter is optional.
Default value: . - disposeCommand Boolean (Optional)
- to dispose the possibly disposable command when the returned ICommandBinding is disposed; to keep the command alive when the returned ICommandBinding is disposed.
Use only if the command will not be re-used elsewhere. This parameter is optional.
Default value: .
ICommandBindingAn
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.
Targets can be added by the
AddTarget method on the result.