Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class AnnotationType

    Show / Hide Table of Contents

    Class AnnotationType

    Specifies the type of annotation template.

    Inheritance
    System.Object
    AnnotationType
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class AnnotationType : Enum
    Remarks
    To know more about using annotation type, refer to these links
    1. DiagramConnectorAnnotation
    2. DiagramNodeAnnotation
    To apply annotation type to a connector, use the below code.
    Examples
    <SfDiagram Height="600px" ModelType="@Model" Connectors="@ConnectorCollection">
       <DiagramTemplates>
           <AnnotationTemplate>
               @{
                   <table style = "width:100%;" >
                       < tbody >
                           < tr >
                               < th class="c1">ID</th>
                               <td class="c1">Label1<b></b></td>
                           </tr>
                           <tr>
                               <th class="c1">Width</th>
                               <td class="c1">
                                   <b>  <input type = "button" value="Click Me"> </b>
                               </td>
                           </tr>
                       </tbody>
                   </table>
               }
           </AnnotationTemplate>
       </DiagramTemplates>
    </SfDiagram>
    @code
    {
    //Defines diagram's connector collection
    public ObservableCollection<DiagramConnector> ConnectorCollection { get; set; }
    public Type Model = typeof(Node);
    public class Node
    {
       public string Id { get; set; }
       public double Width { get; set; }
    }
    protected override void OnInitialized()
    {
        ConnectorCollection = new ObservableCollection<DiagramConnector>();
        DiagramConnector Connector = new DiagramConnector()
        {
            SourcePoint = new ConnectorSourcePoint() { X = 220, Y = 40 },
            TargetPoint = new ConnectorTargetPoint() { X = 310, Y = 150 },
            Type = Segments.Orthogonal,
            Style = new ConnectorShapeStyle() { StrokeColor = "#6BA5D7" },
            Annotations = new ObservableCollection<DiagramConnectorAnnotation>()
            {
                new DiagramConnectorAnnotation() {Id="label2", AnnotationType=AnnotationType.Template },
            }
       };
       ConnectorCollection.Add(Connector);
    }
    }

    Fields

    String

    Specifies that the annotation will be string content.

    Declaration
    public const AnnotationType String
    Field Value
    Type Description
    AnnotationType

    Template

    Specifies that the annotation user defined Html template.

    Declaration
    public const AnnotationType Template
    Field Value
    Type Description
    AnnotationType

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved