Class BasicShape
Describes a geometric basic shape for a Node.
Serialized as { type: 'Basic', shape: '<name>' [, cornerRadius: n] [, points: [...] ] }
in EJ2's NodeModel.
Inherited Members
Namespace: Syncfusion.Maui.Diagram
Assembly: Syncfusion.Maui.Diagram.dll
Syntax
public class BasicShape : Shape
Examples
var node = new Node
{
Shape = new BasicShape { Shape = NodeBasicShapes.Rectangle, CornerRadius = 10 }
};
Constructors
BasicShape()
Initializes a new BasicShape with Rectangle, zero corner radius, and 6 polygon sides.
Declaration
public BasicShape()
BasicShape(NodeBasicShapes, Double)
Initializes a new BasicShape with the given geometry.
Declaration
public BasicShape(NodeBasicShapes shape, double cornerRadius = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeBasicShapes | shape | The basic geometry to draw. |
| System.Double | cornerRadius | Corner radius for rectangles (ignored for other shapes). |
Fields
CornerRadiusProperty
Identifies the CornerRadius bindable property.
Declaration
public static readonly BindableProperty CornerRadiusProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShapeProperty
Identifies the Shape bindable property.
Declaration
public static readonly BindableProperty ShapeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Properties
CornerRadius
Gets or sets the corner radius applied to Rectangle nodes.
Has no visual effect for other shapes. Defaults to 0 (sharp corners).
Serialized as shape.cornerRadius in EJ2.
Declaration
public double CornerRadius { get; set; }
Property Value
| Type |
|---|
| System.Double |
Shape
Gets or sets the specific basic geometry drawn for this node. Defaults to Rectangle.
Declaration
public NodeBasicShapes Shape { get; set; }
Property Value
| Type |
|---|
| NodeBasicShapes |
Type
Gets the family this shape belongs to (Basic or
Flow). Read-only — determined by the concrete subtype.
Used as the EJ2 shape.type discriminator during serialization.
Declaration
public override NodeShapes Type { get; }
Property Value
| Type |
|---|
| NodeShapes |