Click or drag to resize

CommandSourceFactoryTReplace Method

Replaces the specified old command with the new command, preserving it's position in the command stack.

Namespace:  TomsToolbox.Wpf.Composition
Assembly:  TomsToolbox.Wpf.Composition (in TomsToolbox.Wpf.Composition.dll)
Syntax
public T Replace(
	Object? context,
	ICommand oldCommand,
	ICommand newCommand
)

Parameters

context
Type: SystemObject
The context.
oldCommand
Type: System.Windows.InputICommand
The old command.
newCommand
Type: System.Windows.InputICommand
The new command.

Return Value

Type: T
The CommandSource associated with the context
Exceptions
ExceptionCondition
ArgumentExceptionCan't replace a command that has not been attached before;oldCommand
See Also