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) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public T Replace(
	Object? context,
	ICommand oldCommand,
	ICommand newCommand
)

Parameters

context  Object
The context.
oldCommand  ICommand
The old command.
newCommand  ICommand
The new command.

Return Value

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