Blazor

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class IKeyEventArgs - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class IKeyEventArgs

    Notifies while performing key actions.

    Inheritance
    System.Object
    IKeyEventArgs
    Implements
    System.IEquatable<IKeyEventArgs>
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class IKeyEventArgs : Object, IEquatable<IKeyEventArgs>
    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

    Methods

    Equals(IKeyEventArgs)

    Indicates whether the IKeyEventArgs object is equal to another object of the same type.

    Declaration
    public bool Equals(IKeyEventArgs iKeyEventArgs)
    Parameters
    Type Name Description
    IKeyEventArgs iKeyEventArgs

    Diagram key event argument

    Returns
    Type Description
    System.Boolean

    Returns the key actions performed

    Implements

    System.IEquatable<>
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved