Class KeyboardCommand
Specifies a command and a key gesture to define when the command should be executed.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class KeyboardCommand : DiagramObject, IDiagramObject, ICloneable
Examples
private void OnGroup()
{
diagram.Group();
}
Constructors
KeyboardCommand()
Declaration
public KeyboardCommand()
Properties
Gesture
Specifies a combination of keys and key modifiers, on the recognition of which the command should be executed.
Declaration
public KeyGesture Gesture { get; set; }
Property Value
Type |
---|
KeyGesture |
Examples
<summary>
Notifies when to execute the custom keyboard commands .
</summary>
<remarks>
The following code illustrates how to create a custom command.
</remarks>
<example>
<code lang="Razor">
<![CDATA[
<SfDiagramComponent @ref="@diagram" Height="600px" Nodes="@nodes">
@* Initializing the custom commands*@
<CommandManager Commands = "@command">
</CommandManager>
</SfDiagramComponent>
@code
{
// Reference to the diagram
SfDiagramComponent diagram;
DiagramObjectCollection<KeyboardCommand> command = new DiagramObjectCollection<KeyboardCommand>()
{
new Command()
{
Name = "CustomGroup",
Gesture = new KeyGesture() { Key = DiagramKeys.G, Modifiers = ModifierKeys.Control }
},
new Command()
{
Name = "CustomUngroup",
Gesture = new KeyGesture() { Key = DiagramKeys.U, Modifiers = ModifierKeys.Control }
},
};
}
}
Name
Specifies the name of the command.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
System.String |
Examples
<summary>
Notifies when to execute the custom keyboard commands .
</summary>
<remarks>
The following code illustrates how to create a custom command.
</remarks>
<example>
<code lang="Razor">
<![CDATA[
<SfDiagramComponent @ref="@diagram" Height="600px" Nodes="@nodes">
@* Initializing the custom commands*@
<CommandManager Commands = "@command">
</CommandManager>
</SfDiagramComponent>
@code
{
// Reference to the diagram
SfDiagramComponent diagram;
DiagramObjectCollection<KeyboardCommand> command = new DiagramObjectCollection<KeyboardCommand>()
{
new Command()
{
Name = "CustomGroup",
Gesture = new KeyGesture() { Key = DiagramKeys.G, Modifiers = ModifierKeys.Control }
},
new Command()
{
Name = "CustomUngroup",
Gesture = new KeyGesture() { Key = DiagramKeys.U, Modifiers = ModifierKeys.Control }
},
};
}
}
Parameter
Specifies all additional parameters that are required at runtime.
Declaration
public string Parameter { get; set; }
Property Value
Type |
---|
System.String |
Implements
System.ICloneable