Provides a standard set of editing related commands.
Assembly: PresentationFramework (in PresentationFramework.dll)
public static class EditingCommands
public ref class EditingCommands abstract sealed
[<AbstractClass>] [<Sealed>] type EditingCommands = class end
Public NotInheritable Class EditingCommands
Represents the command, which requests that Bold formatting be toggled on the current selection.
Represents the command, which requests that Italic formatting be toggled on the current selection.
Represents the command, which requests that Underline formatting be toggled on the current selection.
Default key gesture
no default key gesture
no default key gesture
Caret movement commands and selection expanding commands share a common set of default key gestures, the general difference being the addition of the Shift key to differentiate selection commands from caret movement commands. For example, the command has a default key gesture of Left, and the corresponding command has a default key gesture of Shift+ Left.
In general, the command definitions provided by the Execute method).class do not make use of command parameters (the parameter parameter expected by the
For more information on commands and commanding, see Input Overview.
The following example demonstrates how to invoke an editing command on an object that supports the command.
For this example, a RichTextBox serves as the command target. Note that RichTextBox implements the IInputElement interface (inherited from FrameworkElement), and that it includes native support for many editing commands.
The first argument for the Execute method is a command parameter. Most editing commands ignore the command parameter; in general, this parameter should be null for editing commands.
The second argument specifies the object to which the command will be routed. This object must implement the IInputElement interface, and should include a handler for the specified command. Generally, a command is ignored when invoked on an object that does not handle the command.
RichTextBox rTB = new RichTextBox(); EditingCommands.ToggleInsert.Execute(null, rTB);
Dim rTB As New RichTextBox() EditingCommands.ToggleInsert.Execute(Nothing, rTB)
Available since 3.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.