CommandCreateBinding(ICommand, Object, String, Object) Method

Creates a binding for a command using the specified source, eventName and targets.

Definition

Namespace: KGySoft.ComponentModel
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public static ICommandBinding CreateBinding(
	this ICommand command,
	Object source,
	string eventName,
	params Object[]? targets
)

Parameters

command  ICommand
The command to bind.
source  Object
The source, which can trigger the command. Can be a Type for static events.
eventName  String
The name of the event on the source that can trigger the command.
targets  Object
Zero or more targets for the binding.

Return Value

ICommandBinding
An ICommandBinding instance, to which the specified source and targets are bound.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ICommand. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also