Class PortMargin
Represents the space from the actual offset values of the port.
Inherited Members
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()