Class Node
Represents a single shape in a SfDiagram.
Inherited Members
Namespace: Syncfusion.Maui.Diagram
Assembly: Syncfusion.Maui.Diagram.dll
Syntax
public class Node : DiagramElement
Remarks
Mirrors the EJ2 Diagram NodeModel JSON shape: { id, offsetX, offsetY, width, height,
rotateAngle, shape: { type: 'Basic', shape }, style, annotations, ports }. Add instances to
Nodes to display them.
Constructors
Node()
Initializes a new instance of the Node class.
Declaration
public Node()
Fields
AddInfoProperty
Identifies the AddInfo bindable property.
Declaration
public static readonly BindableProperty AddInfoProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AnnotationsProperty
Identifies the Annotations bindable property.
Declaration
public static readonly BindableProperty AnnotationsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
HeightProperty
Identifies the Height bindable property.
Declaration
public static readonly BindableProperty HeightProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
IdProperty
Identifies the Id bindable property.
Declaration
public static readonly BindableProperty IdProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
OffsetXProperty
Identifies the OffsetX bindable property.
Declaration
public static readonly BindableProperty OffsetXProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
OffsetYProperty
Identifies the OffsetY bindable property.
Declaration
public static readonly BindableProperty OffsetYProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
PortsProperty
Identifies the Ports bindable property.
Declaration
public static readonly BindableProperty PortsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
RotationAngleProperty
Identifies the RotationAngle bindable property.
Declaration
public static readonly BindableProperty RotationAngleProperty
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 |
StyleProperty
Identifies the Style bindable property.
Declaration
public static readonly BindableProperty StyleProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
WidthProperty
Identifies the Width bindable property.
Declaration
public static readonly BindableProperty WidthProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Properties
AddInfo
Gets or sets arbitrary application data associated with this node (for example, a view-model instance). Not sent to the JavaScript side.
Declaration
public object AddInfo { get; set; }
Property Value
| Type |
|---|
| System.Object |
Annotations
Gets or sets the collection of text labels attached to this node.
Declaration
public ObservableCollection<ShapeAnnotation> Annotations { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<ShapeAnnotation> |
Height
Gets or sets the node's height, in diagram units.
Declaration
public double Height { get; set; }
Property Value
| Type |
|---|
| System.Double |
Id
Gets or sets the node's identifier. Assigned automatically when left null. Used by SourceID/TargetID to attach connectors to this node.
Declaration
public string Id { get; set; }
Property Value
| Type |
|---|
| System.String |
OffsetX
Gets or sets the horizontal position of the node's center, in diagram units.
Declaration
public double OffsetX { get; set; }
Property Value
| Type |
|---|
| System.Double |
OffsetY
Gets or sets the vertical position of the node's center, in diagram units.
Declaration
public double OffsetY { get; set; }
Property Value
| Type |
|---|
| System.Double |
Ports
Gets or sets the collection of named connection points on this node that a Connector can attach to via SourcePortID/TargetPortID.
Declaration
public ObservableCollection<PointPort> Ports { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<PointPort> |
RotationAngle
Gets or sets the clockwise rotation angle, in degrees.
Declaration
public double RotationAngle { get; set; }
Property Value
| Type |
|---|
| System.Double |
Shape
Gets or sets the shape descriptor for this node. Assign a BasicShape for geometric shapes, or a FlowShape for flowchart symbols. When set, this property takes precedence over the legacy Shape enum. Defaults to null, which falls back to Shape for backward compatibility.
Declaration
public Shape Shape { get; set; }
Property Value
| Type |
|---|
| Shape |
Examples
// Basic rounded rectangle
node.Shape = new BasicShape { Shape = NodeBasicShapes.Rectangle, CornerRadius = 8 };
// Flowchart decision diamond
node.Shape = new FlowShape { Shape = NodeFlowShapes.Decision };
Style
Gets or sets the node's fill/stroke appearance.
Declaration
public ShapeStyle Style { get; set; }
Property Value
| Type |
|---|
| ShapeStyle |
Width
Gets or sets the node's width, in diagram units.
Declaration
public double Width { get; set; }
Property Value
| Type |
|---|
| System.Double |