Provides a standard set of editing related commands.
Namespace:
System.Windows.Documents
Assembly:
PresentationFramework (in PresentationFramework.dll)
Visual Basic (Declaration)
Public NotInheritable Class EditingCommands
You do not need to declare an instance of a static class in order to access its members.
public static class EditingCommands
public ref class EditingCommands abstract sealed
public final class EditingCommands
You cannot directly create an instance of this class in XAML.
The following table shows the editing commands and the associated default key gestures (with key names from the Key and ModifierKeys enumerations).
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 MoveLeftByCharacter command has a default key gesture of Left, and the corresponding SelectLeftByCharacter command has a default key gesture of Shift+Left.
In general, the command definitions provided by the EditingCommands class do not make use of command parameters (the parameter parameter expected by the Execute method).
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 nullNothingnullptra null reference (Nothing in Visual Basic) 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);
System..::.Object
System.Windows.Documents..::.EditingCommands
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0
Reference
Other Resources