CommandBindingsCollectionAddTTarget(ActionICommandState, TTarget, IDictionaryString, Object) Method
Namespace: KGySoft.ComponentModelAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
public ICommandBinding Add<TTarget>(
Action<ICommandState, TTarget> callback,
IDictionary<string, Object?>? initialState = null
)
Public Function Add(Of TTarget) (
callback As Action(Of ICommandState, TTarget),
Optional initialState As IDictionary(Of String, Object) = Nothing
) As ICommandBinding
public:
generic<typename TTarget>
ICommandBinding^ Add(
Action<ICommandState^, TTarget>^ callback,
IDictionary<String^, Object^>^ initialState = nullptr
)
member Add :
callback : Action<ICommandState, 'TTarget> *
?initialState : IDictionary<string, Object>
(* Defaults:
let _initialState = defaultArg initialState null
*)
-> ICommandBinding
- callback ActionICommandState, TTarget
- The delegate to create the command from.
- initialState IDictionaryString, Object (Optional)
- The initial state of the binding. This parameter is optional.
Default value: .
- TTarget
- The type of the targets of the command binding.
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.