Class RectangleElement
A rectangle shape element that can be rendered on the canvas.
public class RectangleElement : ShapeElement, ICanvasElement, INotifyPropertyChanged
- Inheritance
-
RectangleElement
- Implements
- Inherited Members
Examples
// Create a swimlane background
var swimlane = new RectangleElement("swimlane-1")
{
Position = new Point(0, 0),
Width = 300,
Height = 600,
Fill = "#ecf0f1",
Stroke = "#bdc3c7",
StrokeWidth = 2,
CornerRadius = 4,
Label = "Development"
};
Remarks
Rectangles are one of the most common shape elements, useful for: - Swimlanes in process diagrams - Containers/groups without the node behavior - Annotations and labels - Background regions
Constructors
RectangleElement()
Creates a new rectangle element with a generated ID.
public RectangleElement()
RectangleElement(string)
Creates a new rectangle element with the specified ID.
public RectangleElement(string id)
Parameters
idstringThe unique identifier for this rectangle.
Properties
CornerRadius
Gets or sets the corner radius for rounded rectangles. A value of 0 creates sharp corners.
public double CornerRadius { get; set; }
Property Value
Type
Gets the type identifier for this element.
public override string Type { get; }
Property Value
Remarks
Used by renderer registries to select the appropriate renderer. For nodes, this typically comes from the node definition's Type property. For shapes, this identifies the shape type (line, rectangle, text, etc.).