Class IKeyEventArgs
Notifies while performing key actions.
Inheritance
System.Object
IKeyEventArgs
Namespace: Syncfusion.Blazor.Diagrams
Assembly: Syncfusion.Blazor.dll
Syntax
public class IKeyEventArgs : Object
Remarks
Blazor property: OnKeyUP | Triggers when the user releases the key |
Blazor property: OnKeyDown | Triggers when the user press the key |
The following code demonstrates how to define IKeyEvent and OnKeyDown property |
Examples
<SfDiagram Height="600px" Nodes="@NodeCollection">
<DiagramEvents OnKeyDown = "Down" ></ DiagramEvents >
</ SfDiagram >
@code
{
public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>();
public void Down(IKeyEventArgs args)
{
if ((args != null) && (args.Key != null) && (args.KeyCode != null) && (args.Label != null) && (args.Text != null))
{
Console.WriteLine("Entered");
}
}
protected override void OnInitialized()
{
// A node is created and stored in the node array.
DiagramNode Node = new DiagramNode()
{
Id = "node1",
Height = 100,
Width = 100,
OffsetX = 300,
OffsetY = 100,
Annotations = new ObservableCollection<DiagramNodeAnnotation>()
{
// An annotation is created and stored in an Annotation collection of Node.
new DiagramNodeAnnotation() { Content = "Offset(0,0)", Offset = new NodeAnnotationOffset() { X = 0, Y = 0 }}
}
};
NodeCollection.Add(Node);
}
}
Constructors
IKeyEventArgs()
Declaration
public IKeyEventArgs()
Properties
Element
Returns the selected element of the diagram.
Declaration
public DiagramSelectedItems Element { get; set; }
Property Value
Type | Description |
---|---|
DiagramSelectedItems |
Key
Returns the value of the key action.
Declaration
public string Key { get; set; }
Property Value
Type | Description |
---|---|
System.String |
KeyCode
Returns a number that represents the actual key pressed.
Declaration
public double KeyCode { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
KeyModifiers
Returns any, modifier keys were pressed when the flick gesture occurred.
Declaration
public KeyModifiers KeyModifiers { get; set; }
Property Value
Type | Description |
---|---|
KeyModifiers |
Label
Returns the label which is being edited.
Declaration
public object Label { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Target
Returns the Id of the text box element in an editing mode.
Declaration
public string Target { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Text
Returns the text content of the label which is currently editing.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |