alexa
menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class ShapeAnnotation

    Represents a text label attached to a Node or a Connector.

    Inheritance
    System.Object
    DiagramElement
    ShapeAnnotation
    Inherited Members
    DiagramElement.OnPropertyChanged(String)
    Namespace: Syncfusion.Maui.Diagram
    Assembly: Syncfusion.Maui.Diagram.dll
    Syntax
    public class ShapeAnnotation : DiagramElement
    Remarks

    Mirrors the EJ2 Diagram ShapeAnnotationModel / PathAnnotationModel JSON shape: { id, content, offset: { x, y }, horizontalAlignment, verticalAlignment, style }.

    Constructors

    ShapeAnnotation()

    Initializes a new instance of the ShapeAnnotation class.

    Declaration
    public ShapeAnnotation()

    ShapeAnnotation(String)

    Initializes a new instance of the ShapeAnnotation class with the given label text.

    Declaration
    public ShapeAnnotation(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

    OffsetProperty

    Identifies the Offset bindable property.

    Declaration
    public static readonly BindableProperty OffsetProperty
    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

    Offset

    Gets or sets the annotation's placement as a normalized point. The X coordinate (0 to 1) represents horizontal placement from left edge (0) to right edge (1) of the node's bounds. The Y coordinate (0 to 1) represents vertical placement from top edge (0) to bottom edge (1). On a Connector, only the X coordinate is used for placement along the connector path, while Y is ignored.

    Declaration
    public Point Offset { get; set; }
    Property Value
    Type
    Microsoft.Maui.Graphics.Point

    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
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved