ICommandBindingWithParameter Method
Specifies a callback to obtain the command parameter value for the underlying
ICommand.
It is evaluated once whenever a source event is triggered. If this
ICommandBinding has multiple targets,
the
ICommand.Execute method is invoked with the same parameter value for each target.
Namespace: KGySoft.ComponentModelAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
ICommandBinding WithParameter(
Func<Object?>? getParameterValue
)
Function WithParameter (
getParameterValue As Func(Of Object)
) As ICommandBinding
ICommandBinding^ WithParameter(
Func<Object^>^ getParameterValue
)
abstract WithParameter :
getParameterValue : Func<Object> -> ICommandBinding
- getParameterValue FuncObject
- A function, which returns the parameter value before the underlying ICommand is executed.
ICommandBindingThis
ICommandBinding instance to provide fluent initialization.
Calling the
WithParameter method multiple times on the same
ICommandBinding instance
just overwrites the lastly set callback function. To use more parameter values the function should return a compound type such as an array or tuple.
It is recommended to specify the parameter callback before adding any sources to avoid the possible
issues if there is any chance that the source can be triggered before completing the initialization.