Class Palette
Represents a symbol palette that organizes and displays a categorized collection of diagram symbols with a descriptive heading.
Inheritance
Namespace: Syncfusion.Blazor.Diagram.SymbolPalette
Assembly: Syncfusion.Blazor.dll
Syntax
public class Palette : Object, IPaletteObject, IDiagramObject, ICloneable
Remarks
Provides a container for grouping related symbols with expandable interface and customizable titles.
Examples
new Palette()
{
Id = "BasicShape",
Expanded = true,
Symbols = BasicShape,
Title = "Basic Shapes",
IconCss = "e-ddb-icons e-basic"
}
Constructors
Palette()
Initializes a new instance of the Palette class with default values.
Declaration
public Palette()
Remarks
Creates a palette with empty symbol collection and default configuration settings.
Palette(Palette)
Initializes a new instance of the Palette class by copying properties and symbols from the specified source palette.
Declaration
public Palette(Palette src)
Parameters
Type | Name | Description |
---|---|---|
Palette | src | The source palette to copy data from. |
Remarks
Creates a new palette instance with duplicated properties and symbol collection from the source palette.
Properties
IconCss
Gets or sets the CSS class name for styling the symbol palette group.
Declaration
public string IconCss { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the CSS class of the palette. The default value is an empty string. |
Remarks
This class is applied to the palette container for custom styling and appearance customization.
Examples
<SfSymbolPaletteComponent Height="600px" Palettes="@Palettes">
</SfSymbolPaletteComponent >
@code
{
DiagramObjectCollection<Palette> Palettes;
Palettes = new DiagramObjectCollection<Palette>(){
new Palette(){Symbols =Tnodes,Title="Flow Shapes",ID="Flow Shapes",IsExpanded = false },
};
}
ID
Gets or sets the unique identifier for the symbol palette group.
Declaration
public string ID { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the unique ID of the palette. The default value is an empty string. |
Remarks
This identifier is used to distinguish between different palette groups within the symbol palette component.
Examples
<SfSymbolPaletteComponent Height="600px" Palettes="@Palettes">
</SfSymbolPaletteComponent >
@code
{
DiagramObjectCollection<Palette> Palettes;
Palettes = new DiagramObjectCollection<Palette>(){
new Palette(){Symbols =Tnodes,Title="Flow Shapes",ID="Flow Shapes" },
};
}
IsExpanded
Gets or sets a value indicating whether the palette is expanded to show its symbols.
Declaration
public bool IsExpanded { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Controls the visibility state of the palette's symbol collection in the user interface.
Examples
<SfSymbolPaletteComponent Height="600px" Palettes="@Palettes">
</SfSymbolPaletteComponent>
@code
{
DiagramObjectCollection<Palette> Palettes;
protected override void OnInitialized()
{
Palettes = new DiagramObjectCollection<Palette>()
{
new Palette()
{
Symbols = FlowNodes,
Title = "Flow Shapes",
ID = "Flow Shapes",
IsExpanded = false
}
};
}
}
Symbols
Gets or sets the collection of predefined symbols available in the palette.
Declaration
public DiagramObjectCollection<NodeBase> Symbols { get; set; }
Property Value
Type | Description |
---|---|
DiagramObjectCollection<NodeBase> | A collection of diagram objects representing the symbols. The default value is an empty collection. |
Remarks
Contains the symbols that users can drag and drop from the palette into the diagram.
Examples
<SfSymbolPaletteComponent Height="600px" Palettes="@Palettes">
</SfSymbolPaletteComponent >
@code
{
DiagramObjectCollection<Palette> Palettes;
Palettes = new DiagramObjectCollection<Palette>(){
new Palette(){Symbols =Tnodes,Title="Flow Shapes",ID="Flow Shapes",IsExpanded = false },
};
}
Title
Gets or sets the display title for the symbol palette group.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the title of the palette. The default value is an empty string. |
Remarks
The title appears as a header for the palette group in the user interface.
Examples
<SfSymbolPaletteComponent Height="600px" Palettes="@Palettes">
</SfSymbolPaletteComponent >
@code
{
DiagramObjectCollection<Palette> Palettes;
Palettes = new DiagramObjectCollection<Palette>(){
new Palette(){Symbols =Tnodes,Title="Flow Shapes",ID="Flow Shapes",IsExpanded = false },
};
}
Methods
Clone()
Creates a copy of the current palette.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | A new palette instance that is a copy of the current palette. |
OnPropertyChanged(String, Object, Object, IDiagramObject)
Invoked when a property value changes on this Symbol palette object.
Declaration
public void OnPropertyChanged(string propertyName, object newVal, object oldVal, IDiagramObject container)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | The name of the property that changed. |
System.Object | newVal | The new property value. |
System.Object | oldVal | The previous property value. |
IDiagramObject | container | The diagram object container. |
OnPropertyChanged(String, Object, Object, IPaletteObject)
Invoked when a property value changes on this Symbol palette object.
Declaration
public void OnPropertyChanged(string propertyName, object newVal, object oldVal, IPaletteObject container)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | The name of the property that changed. |
System.Object | newVal | The new property value. |
System.Object | oldVal | The previous property value. |
IPaletteObject | container | The palette object container. |