Class DiagramThickness
Represents a DiagramThickness that describes the thickness of a frame around a rectangle in diagram elements.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class DiagramThickness : DiagramObject, IDiagramObject, ICloneable
Remarks
The DiagramThickness class provides properties to define different thickness values for each side of a rectangular frame, commonly used for borders, margins, and padding in diagram components.
Examples
The following example demonstrates how to create and use a DiagramThickness instance:
// Create a new DiagramThickness with uniform thickness
DiagramThickness thickness = new DiagramThickness()
{
Left = 2.0,
Right = 2.0,
Top = 1.0,
Bottom = 1.0
};
Constructors
DiagramThickness()
Initializes a new instance of the TextElement.
Declaration
public DiagramThickness()
DiagramThickness(DiagramThickness)
Initializes a new instance of the DiagramThickness class by copying values from the specified source instance.
Declaration
public DiagramThickness(DiagramThickness src)
Parameters
Type | Name | Description |
---|---|---|
DiagramThickness | src | The source DiagramThickness instance to copy from. If null, creates an instance with default thickness values. |
Properties
Bottom
Gets or sets the bottom value of the DiagramThickness.
Declaration
public double Bottom { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the bottom thickness value in pixels. The default value is |
Remarks
This property defines the bottom padding or margin value for diagram elements. Changes to this property will trigger property change notifications to the parent object.
Examples
The following example demonstrates how to set the bottom thickness value for a connector's fixed user handle padding.
Connector connector = new Connector()
{
FixedUserHandles = new DiagramObjectCollection<ConnectorFixedUserHandle>()
{
new ConnectorFixedUserHandle()
{
Visibility = true,
Padding = new DiagramThickness() { Bottom = 1 },
}
}
};
Left
Gets or sets the left value of the DiagramThickness.
Declaration
public double Left { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the left thickness value in pixels. The default value is |
Remarks
This property defines the left padding or margin value for diagram elements. Changes to this property will trigger property change notifications to the parent object.
Examples
The following example demonstrates how to set the left thickness value for a connector's fixed user handle padding.
Connector connector = new Connector()
{
FixedUserHandles = new DiagramObjectCollection<ConnectorFixedUserHandle>()
{
new ConnectorFixedUserHandle()
{
Visibility = true,
Padding = new DiagramThickness() { Left = 1 },
}
}
};
Right
Gets or sets the right value of the DiagramThickness.
Declaration
public double Right { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the right thickness value in pixels. The default value is |
Remarks
This property defines the right padding or margin value for diagram elements. Changes to this property will trigger property change notifications to the parent object.
Examples
The following example demonstrates how to set the right thickness value for a connector's fixed user handle padding.
Connector connector = new Connector()
{
FixedUserHandles = new DiagramObjectCollection<ConnectorFixedUserHandle>()
{
new ConnectorFixedUserHandle()
{
Padding = new DiagramThickness() { Right = 1 },
}
},
};
Top
Gets or sets the top value of the DiagramThickness.
Declaration
public double Top { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the top thickness value in pixels. The default value is |
Remarks
This property defines the top padding or margin value for diagram elements. Changes to this property will trigger property change notifications to the parent object.
Examples
The following example demonstrates how to set the top thickness value for a connector's fixed user handle padding.
Connector connector = new Connector()
{
FixedUserHandles = new DiagramObjectCollection<ConnectorFixedUserHandle>()
{
new ConnectorFixedUserHandle()
{
Visibility = true,
Padding = new DiagramThickness() { Top = 1 },
}
}
};
Methods
Clone()
Creates a deep copy of the current DiagramThickness instance.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new DiagramThickness object that is a deep copy of the current instance, |