Class SymbolDescription
Specifies the description of the symbol.
Inheritance
System.Object
SymbolDescription
Implements
System.IEquatable<SymbolDescription>
Namespace: Syncfusion.Blazor.Diagrams
Assembly: Syncfusion.Blazor.dll
Syntax
public class SymbolDescription : Object, IEquatable<SymbolDescription>
Examples
<SfDiagram ID="diagram" Width="500px" Height="600px">
<SfSymbolPalette Width = "100px" Height="600px" SymbolHeight="60" SymbolWidth="60" SymbolInfo="@SymbolInfo">
<SymbolPalettePalettes>
@* Sets the palette header property for the symbols *@
<SymbolPalettePalette Id = "basic" Expanded="true" Symbols="@BasicShapes" IconCss="e-ddb-icons e-flow" Title="Group Shapes">
</SymbolPalettePalette>
</SymbolPalettePalettes>
</SfSymbolPalette>
</SfDiagram>
@code{
// Defines palette's basic-shape collection
public ObservableCollection<DiagramNode> BasicShapes { get; set; }
public SymbolInfo SymbolInfo;
protected override void OnInitialized()
{
///Sets the size, appearance and description of a symbol
SymbolInfo = new SymbolInfo()
{
Description = new SymbolDescription()
{
Text = "GroupCollection",
Overflow = TextOverflow.Wrap,
Wrap = TextWrap.Wrap
},
Height = 50,
Width = 50
};
//Initialize the basicshapes for the symbol palette
BasicShapes = new ObservableCollection<DiagramNode>();
DiagramNode GroupNode = createNode("groupnode", 100, 100, "GroupNode", Syncfusion.Blazor.Diagrams.BasicShapes.Rectangle);
DiagramNode Node1 = createNode("node1", 100, 100, "Node1", Syncfusion.Blazor.Diagrams.BasicShapes.Rectangle);
DiagramNode Node2 = createNode("node2", 150, 150, "Node2", Syncfusion.Blazor.Diagrams.BasicShapes.Ellipse);
//Grouping node 1 and node 2 into a single group
GroupNode.Children = new string[] { "Node1", "Node2" };
BasicShapes.Add(Node1);
BasicShapes.Add(Node2);
BasicShapes.Add(GroupNode);
}
public DiagramNode createNode(string id, double offx, double offy, string content, Syncfusion.Blazor.Diagrams.BasicShapes shape)
{
DiagramNodeAnnotation Annotation = new DiagramNodeAnnotation()
{
Id = "annotation1",
Content = content,
Style = new AnnotationStyle() { Color = "white", Fill = "transparent", StrokeColor = "None" },
};
if (content == "GroupNode")
{
Annotation.Style.Color = "black";
}
DiagramNode Node = new DiagramNode()
{
Id = id,
OffsetX = offx,
OffsetY = offy,
Height = 50,
Width = 50,
Shape = new DiagramShape() { Type = Shapes.Basic, BasicShape = shape },
Annotations = new ObservableCollection<DiagramNodeAnnotation>() { Annotation }
};
if (content != "GroupNode")
{
Node.Style = new NodeShapeStyle() { Fill = "#6BA5D7" };
}
return Node;
}
}
Constructors
SymbolDescription()
Declaration
public SymbolDescription()
Properties
Overflow
Represents how to handle the text when its size exceeds the given symbol size. By default, it's set to Ellipsis.
Declaration
public TextOverflow Overflow { get; set; }
Property Value
Type | Description |
---|---|
TextOverflow |
Text
Specifies the symbol description.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Wrap
Specifies how the text should be wrapped when the text size exceeds some specific bounds. By default, it's set to wrap.
Declaration
public TextWrap Wrap { get; set; }
Property Value
Type | Description |
---|---|
TextWrap |
Methods
Equals(SymbolDescription)
Indicates whether the SymbolDescription object is equal to another object of the same type.
Declaration
public bool Equals(SymbolDescription symbolDescription)
Parameters
Type | Name | Description |
---|---|---|
SymbolDescription | symbolDescription | The description of the symbol. |
Returns
Type | Description |
---|---|
System.Boolean | Return the description added to the symbol |
Implements
System.IEquatable<>