Class ContainerHeader
Represents the header for a Container, providing additional details such as a title, label, or other descriptive information.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class ContainerHeader : NodeBase, IDiagramObject, ICloneable
Constructors
ContainerHeader()
Declaration
public ContainerHeader()
ContainerHeader(ContainerHeader)
Declaration
public ContainerHeader(ContainerHeader header)
Parameters
Type | Name | Description |
---|---|---|
ContainerHeader | header |
Properties
Annotation
Gets or sets the annotation of the header.
Declaration
public ShapeAnnotation Annotation { get; set; }
Property Value
Type | Description |
---|---|
ShapeAnnotation | The annotation of the header. |
Remarks
The annotation represents the content displayed in the header.
Examples
@using Syncfusion.Blazor.Diagram
<SfDiagramComponent @ref="@diagram" Height= "600px" Nodes= "@nodes" Connectors="@connectors" />
@code
{
SfDiagramComponent diagram;
//Initialize the node collection
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
//Initialize the connector collection
DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
protected override void OnInitialized()
{
Node node1 = new Node()
{
ID = "node1",
Height = 50,
Width = 50,
OffsetX = 100,
OffsetY = 200
};
Node node2 = new Node()
{
ID = "node2",
Height = 50,
Width = 50,
OffsetX = 200,
OffsetY = 200
};
Connector connector = new Connector()
{
ID = "connector",
SourcePoint = new DiagramPoint() { X = 300, Y = 200 },
TargetPoint = new DiagramPoint() { X = 400, Y = 300 }
};
Container container = new Container()
{
ID = "container",
Header = new ContainerHeader()
{
ID = "containerHeader",
Annotation = new ShapeAnnotation()
{
Content = "New Container"
},
Style = new TextStyle()
{
Fill = "yellow"
},
Height = 50
},
Children = new string[] { "node1", "node2", "connector" },
Height = 200, Width = 200
};
nodes.Add(node1);
nodes.Add(node2);
connectors.Add(connector);
nodes.Add(container);
}
}
Height
Gets or sets the height of the container header.
Declaration
public Nullable<double> Height { get; set; }
Property Value
Type |
---|
System.Nullable<System.Double> |
Examples
@using Syncfusion.Blazor.Diagram
<SfDiagramComponent @ref="@diagram" Height= "600px" Nodes= "@nodes" Connectors="@connectors"/>
@code
{
SfDiagramComponent diagram;
//Initialize the node collection
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
//Initialize the connector collection
DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
protected override void OnInitialized()
{
Node node1 = new Node()
{
ID = "node1",
Height = 50,
Width = 50,
OffsetX = 100,
OffsetY = 200
};
Node node2 = new Node()
{
ID = "node2",
Height = 50,
Width = 50,
OffsetX = 200,
OffsetY = 200
};
Connector connector = new Connector()
{
ID = "connector",
SourcePoint = new DiagramPoint() { X = 300, Y = 200 },
TargetPoint = new DiagramPoint() { X = 400, Y = 300 }
};
Container container = new Container()
{
ID = "container",
Header = new ContainerHeader()
{
ID = "containerHeader",
Annotation = new ShapeAnnotation()
{
Content = "New Container"
},
Style = new TextStyle()
{
Fill = "yellow"
},
Height = 50
},
Children = new string[] { "node1", "node2", "connector" },
Height = 200, Width = 200
};
nodes.Add(node1);
nodes.Add(node2);
connectors.Add(connector);
nodes.Add(container);
}
}
Style
Gets or sets the style of the header text.
Declaration
public TextStyle Style { get; set; }
Property Value
Type | Description |
---|---|
TextStyle | The style of the header text. |
Remarks
Use this property to apply custom styling to the header text, such as font size, color, or alignment.
Examples
@using Syncfusion.Blazor.Diagram
<SfDiagramComponent @ref="@diagram" Height= "600px" Nodes= "@nodes" Connectors="@connectors"/>
@code
{
SfDiagramComponent diagram;
//Initialize the node collection
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
//Initialize the connector collection
DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
protected override void OnInitialized()
{
Node node1 = new Node()
{
ID = "node1",
Height = 50,
Width = 50,
OffsetX = 100,
OffsetY = 200
};
Node node2 = new Node()
{
ID = "node2",
Height = 50,
Width = 50,
OffsetX = 200,
OffsetY = 200
};
Connector connector = new Connector()
{
ID = "connector",
SourcePoint = new DiagramPoint() { X = 300, Y = 200 },
TargetPoint = new DiagramPoint() { X = 400, Y = 300 }
};
Container container = new Container()
{
ID = "container",
Header = new ContainerHeader()
{
ID = "containerHeader",
Annotation = new ShapeAnnotation()
{
Content = "New Container"
},
Style = new TextStyle()
{
Fill = "yellow"
},
Height = 50
},
Children = new string[] { "node1", "node2", "connector" },
Height = 200, Width = 200
};
nodes.Add(node1);
nodes.Add(node2);
connectors.Add(connector);
nodes.Add(container);
}
}
Width
Gets or sets the width of the container header.
Declaration
public Nullable<double> Width { get; set; }
Property Value
Type |
---|
System.Nullable<System.Double> |
Examples
@using Syncfusion.Blazor.Diagram
<SfDiagramComponent @ref="@diagram" Height= "600px" Nodes= "@nodes" Connectors="@connectors"/>
@code
{
SfDiagramComponent diagram;
//Initialize the node collection
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
//Initialize the connector collection
DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
protected override void OnInitialized()
{
Node node1 = new Node()
{
ID = "node1",
Height = 50,
Width = 50,
OffsetX = 100,
OffsetY = 200
};
Node node2 = new Node()
{
ID = "node2",
Height = 50,
Width = 50,
OffsetX = 200,
OffsetY = 200
};
Connector connector = new Connector()
{
ID = "connector",
SourcePoint = new DiagramPoint() { X = 300, Y = 200 },
TargetPoint = new DiagramPoint() { X = 400, Y = 300 }
};
Container container = new Container()
{
ID = "container",
Header = new ContainerHeader()
{
ID = "containerHeader",
Annotation = new ShapeAnnotation()
{
Content = "New Container"
},
Style = new TextStyle()
{
Fill = "yellow"
},
Height = 50, Width = 200
},
Children = new string[] { "node1", "node2", "connector" },
Height = 200, Width = 200
};
nodes.Add(node1);
nodes.Add(node2);
connectors.Add(connector);
nodes.Add(container);
}
}
Methods
Clone()
Creates a new instance of the ContainerHeader class that is a copy of the current instance.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new ContainerHeader object that is a copy of this instance. |
Overrides
Implements
System.ICloneable