Blazor

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

    Show / Hide Table of Contents

    Class PortMargin

    Represents the space from the actual offset values of the port.

    Inheritance
    System.Object
    SfDiagramBase
    DiagramMargin
    PortMargin
    Inherited Members
    DiagramMargin.Bottom
    DiagramMargin.Left
    DiagramMargin.Right
    DiagramMargin.Top
    SfDiagramBase.UpdateCollection(IList, Boolean)
    SfDiagramBase.RandomString(Int32)
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class PortMargin : DiagramMargin
    Remarks

    By default, it will be 0 from all sides. The following code shows how to define PortMargin and its properties.

    Examples
    <SfDiagram Height="600px" Nodes="@NodeCollection">
    </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" },
           // Initialize port collection
           Ports = new ObservableCollection<DiagramPort>() {
           new DiagramPort() {
               Id = "port1", Visibility = PortVisibility.Visible,
               //Set the style for the port
               Style= new PortShapeStyle(){ Fill="gray"},
               //set the margin to the port
               Margin = new PortMargin{Top= 10,Bottom=0,Left=10,Right=0}
               }
             },
         };
         NodeCollection.Add(Node);
       }
    }

    Constructors

    PortMargin()

    Represents the space from the actual offset values of the port.

    Declaration
    public PortMargin()
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved