Class SymbolDescription
Represents the textual description and display properties of a symbol.
Inheritance
Namespace: Syncfusion.Blazor.Diagram.SymbolPalette
Assembly: Syncfusion.Blazor.dll
Syntax
public class SymbolDescription : Object
Remarks
This class provides configuration for how symbol descriptions are displayed within symbol palette components.
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 | Description |
---|---|
DiagramThickness | The default value is DiagramThickness with all sides set to 0. |
Remarks
Defines the spacing around the text content within the symbol description area.
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 |
Remarks
Configures the display properties for symbol descriptions in symbol palette components.
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;
}
}