Blazor

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

    Show / Hide Table of Contents

    Class IconOffset

    Represents the position of the icon at the bounds of the node.

    Inheritance
    System.Object
    SfDiagramBase
    IconOffset
    Inherited Members
    SfDiagramBase.UpdateCollection(IList, Boolean)
    SfDiagramBase.RandomString(Int32)
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class IconOffset : SfDiagramBase
    Remarks
    IconOffset is used to align the icon in the node based on the fractions. Fraction values are range from 0 to 1. By default, the offset values will be X=0.5 and Y=1.
    1. When x= 0 and y = 0, then the icon will be position at the top left corner of the node.
    2. When x= 0.5 and y = 0.5, then the icon will be position at the center of the node.
    3. When x= 1 and y = 1, then the icon will be position at the bottom right corner of the node.
    Examples
      
    <SfDiagram Height="600px" Nodes="@NodeCollection">
      <DiagramSnapSettings Constraints = "SnapConstraints.None" ></ DiagramSnapSettings >
    </ SfDiagram >
    @code{
      public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>() { };
      protected override void OnInitialized()
      {
        // A node is created and stored in nodes collection.
        DiagramNode Node = new DiagramNode()
        {
         // Position of the node
         OffsetX = 250,
         OffsetY = 250,
         // Size of the node
         Width = 100,
         Height = 100,
         Style = new NodeShapeStyle() { Fill = "#6BA5D7", StrokeColor = "white" },
         ExpandIcon = new NodeExpandIcon()
         {
           Width = 20,
           Height = 20,
           Shape = IconShapes.ArrowDown,
           Fill = "red",
           //set the offset value to the expand icon
           Offset = new IconOffset() { X = 0, Y = 0 }
          },
        };
        NodeCollection.Add(Node);
     }

    Constructors

    IconOffset()

    Represents the position of the icon at the bounds of the node.

    Declaration
    public IconOffset()

    Properties

    X

    Gets or sets the x coordinate position of the icon. By default, it is set to 0.5.

    Declaration
    public Nullable<double> X { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Double>

    Y

    Gets or sets the Y coordinate position of the icon. By default, it is set to 1.

    Declaration
    public Nullable<double> Y { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Double>
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved