Class Annotation
Inherited Members
Namespace: Syncfusion.Maui.Diagram
Assembly: Syncfusion.Maui.Diagram.dll
Syntax
public class Annotation : DiagramElement
Remarks
Mirrors the EJ2 Diagram ShapeAnnotationModel / PathAnnotationModel JSON shape:
{ id, content, offset: { x, y }, horizontalAlignment, verticalAlignment, style }.
Constructors
Annotation()
Initializes a new instance of the Annotation class.
Declaration
public Annotation()
Annotation(String)
Initializes a new instance of the Annotation class with the given label text.
Declaration
public Annotation(string content)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | content | The label text. |
Fields
ContentProperty
Identifies the Content bindable property.
Declaration
public static readonly BindableProperty ContentProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
HorizontalAlignmentProperty
Identifies the HorizontalAlignment bindable property.
Declaration
public static readonly BindableProperty HorizontalAlignmentProperty
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 |
StyleProperty
Identifies the Style bindable property.
Declaration
public static readonly BindableProperty StyleProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
VerticalAlignmentProperty
Identifies the VerticalAlignment bindable property.
Declaration
public static readonly BindableProperty VerticalAlignmentProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Properties
Content
Gets or sets the label text.
Declaration
public string Content { get; set; }
Property Value
| Type |
|---|
| System.String |
HorizontalAlignment
Gets or sets the horizontal alignment relative to the offset point. On a Connector,
this is mapped to EJ2's "Before"/"Center"/"After" path-relative alignment
(Left → "Before",
Right → "After", anything else → "Center");
VerticalAlignment has no connector-label equivalent and is ignored there.
Declaration
public AnnotationHorizontalAlignment HorizontalAlignment { get; set; }
Property Value
| Type |
|---|
| AnnotationHorizontalAlignment |
Id
Gets or sets the annotation's identifier. Assigned automatically when left null.
Declaration
public string Id { get; set; }
Property Value
| Type |
|---|
| System.String |
OffsetX
Gets or sets the annotation's horizontal placement. On a Node, this is normalized from 0 (left edge) to 1 (right edge) of the node's bounds. On a Connector, this is reused as the single 0 (source end) to 1 (target end) fraction of distance along the path — EJ2 connector labels have no independent Y offset, so OffsetY is ignored there.
Declaration
public double OffsetX { get; set; }
Property Value
| Type |
|---|
| System.Double |
OffsetY
Gets or sets the vertical placement of the annotation, normalized from 0 (top edge) to 1 (bottom edge) of its owning Node's bounds. Not applicable to connector labels (see OffsetX).
Declaration
public double OffsetY { get; set; }
Property Value
| Type |
|---|
| System.Double |
Style
Gets or sets the text/background appearance.
Declaration
public TextStyle Style { get; set; }
Property Value
| Type |
|---|
| TextStyle |
VerticalAlignment
Gets or sets the vertical alignment relative to the offset point.
Declaration
public AnnotationVerticalAlignment VerticalAlignment { get; set; }
Property Value
| Type |
|---|
| AnnotationVerticalAlignment |