Class SymbolDescription
Represents the textual description of a symbol.
Inheritance
Namespace: Syncfusion.Blazor.Diagram.SymbolPalette
Assembly: Syncfusion.Blazor.dll
Syntax
public class SymbolDescription : Object
Examples
<SfSymbolPaletteComponent Height="600px" GetSymbolInfo="GetSymbolInfo" >
</SfSymbolPaletteComponent >
@code
{
private SymbolInfo GetSymbolInfo(IDiagramObject symbol)
{
SymbolInfo SymbolInfo = new SymbolInfo();
SymbolInfo.Fit = true;
string text = null;
if (symbol is Node)
{
text = ((symbol as Node).Shape as Shape).Type.ToString() + (symbol as Node).ID;
}
SymbolInfo.Description = new SymbolDescription() { Text = text };
return SymbolInfo;
}
}
Constructors
SymbolDescription()
Declaration
public SymbolDescription()
Properties
Margin
Gets or sets the Margin to the text rendered in the symbol palette.
Declaration
public DiagramThickness Margin { get; set; }
Property Value
Type |
---|
DiagramThickness |
Examples
<SfSymbolPaletteComponent Height="600px" Palettes="@Palettes" GetSymbolInfo="GetSymbolInfo">
</SfSymbolPaletteComponent>
@code
{
DiagramObjectCollection<Palette> Palettes = new DiagramObjectCollection<Palette>();
DiagramObjectCollection<NodeBase> Nodes = new DiagramObjectCollection<NodeBase>();
private SymbolInfo GetSymbolInfo(IDiagramObject symbol)
{
SymbolInfo SymbolInfo = new SymbolInfo();
SymbolInfo.Fit = true;
string text = null;
if (symbol is Node)
{
text = ((symbol as Node).Shape as Shape).Type.ToString() + (symbol as Node).ID;
}
SymbolInfo.Description = new SymbolDescription() { Text = text, Margin = new DiagramThickness(){ Top = 10 } };
return SymbolInfo;
}
protected override void OnInitialized()
{
Nodes = new DiagramObjectCollection<NodeBase>();
Node node1 = new Node()
{
ID = "node1",
Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Decision }
};
Nodes.Add(node1);
Palettes = new DiagramObjectCollection<Palette>()
{
new Palette(){Symbols =Nodes,Title="Flow Shapes",ID="Flow Shapes" },
};
}
}
Style
Gets or sets the style of a text in the symbol palette.
Declaration
public TextStyle Style { get; set; }
Property Value
Type | Description |
---|---|
TextStyle | Default value of font color is black. Default value of fill is transparent. Default value of font size is 12. Default value of font family is Arial. Default value of text decoration is None |
Remarks
The style is applicable only the following properties are Color, Fill, Fontsize, FontFamily, Bold, Italic, TextDecoration, TextWrapping, TextOverflow.
Examples
@using Syncfusion.Blazor.Diagram.SymbolPalette
<SfSymbolPaletteComponent Height="600px" Palettes="@Palettes" GetSymbolInfo="GetSymbolInfo">
</SfSymbolPaletteComponent>
@code
{
DiagramObjectCollection<Palette> Palettes = new DiagramObjectCollection<Palette>();
DiagramObjectCollection<NodeBase> Nodes = new DiagramObjectCollection<NodeBase>();
private SymbolInfo GetSymbolInfo(IDiagramObject symbol)
{
SymbolInfo SymbolInfo = new SymbolInfo();
SymbolInfo.Fit = true;
string text = null;
if (symbol is Node)
{
text = ((symbol as Node).Shape as Shape).Type.ToString() + (symbol as Node).ID;
}
SymbolInfo.Description = new SymbolDescription()
{
Text = text,
Style = new TextStyle()
{
TextWrapping = TextWrap.NoWrap,
FontSize = 12,
Fill = "#05DAC5",
Color = "red"
},
Margin = new DiagramThickness()
{
Top = 10,
Bottom = 0,
Left = 0,
Right = 0
}
};
return SymbolInfo;
}
protected override void OnInitialized()
{
Nodes = new DiagramObjectCollection<NodeBase>();
Node node1 = new Node()
{
ID = "node1",
Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Decision }
};
Nodes.Add(node1);
Palettes = new DiagramObjectCollection<Palette>()
{
new Palette(){Symbols =Nodes,Title="Flow Shapes",ID="Flow Shapes" },
};
}
}
Text
Represents the textual information to be displayed in the symbol.
Declaration
public string Text { get; set; }
Property Value
Type |
---|
System.String |
Examples
<SfSymbolPaletteComponent Height="600px" GetSymbolInfo="GetSymbolInfo" >
</SfSymbolPaletteComponent >
@code
{
private SymbolInfo GetSymbolInfo(IDiagramObject symbol)
{
SymbolInfo SymbolInfo = new SymbolInfo();
SymbolInfo.Fit = true;
string text = null;
if (symbol is Node)
{
text = ((symbol as Node).Shape as Shape).Type.ToString() + (symbol as Node).ID;
}
SymbolInfo.Description = new SymbolDescription() { Text = text };
return SymbolInfo;
}
}
TextOverflow
Specifies a value that indicates whether to render ellipses (...) to indicate text overflow. By default, it is wrapped.
Declaration
public TextOverflow TextOverflow { get; set; }
Property Value
Type |
---|
TextOverflow |
Examples
<SfSymbolPaletteComponent Height="600px" GetSymbolInfo="GetSymbolInfo" >
</SfSymbolPaletteComponent >
@code
{
private SymbolInfo GetSymbolInfo(IDiagramObject symbol)
{
SymbolInfo SymbolInfo = new SymbolInfo();
SymbolInfo.Fit = true;
string text = null;
if (symbol is Node)
{
text = ((symbol as Node).Shape as Shape).Type.ToString() + (symbol as Node).ID;
}
SymbolInfo.Description = new SymbolDescription() { Text = text,TextOverflow=TextOverflow.Wrap, };
return SymbolInfo;
}
}
TextWrapping
Wraps the text to the next line when it exceeds its bounds.
Declaration
public TextWrap TextWrapping { get; set; }
Property Value
Type |
---|
TextWrap |
Examples
<SfSymbolPaletteComponent Height="600px" GetSymbolInfo="GetSymbolInfo" >
</SfSymbolPaletteComponent >
@code
{
private SymbolInfo GetSymbolInfo(IDiagramObject symbol)
{
SymbolInfo SymbolInfo = new SymbolInfo();
SymbolInfo.Fit = true;
string text = null;
if (symbol is Node)
{
text = ((symbol as Node).Shape as Shape).Type.ToString() + (symbol as Node).ID;
}
SymbolInfo.Description = new SymbolDescription() { Text = text,TextWrapping= TextWrap.Wrap };
return SymbolInfo;
}
}