Class SymbolPalette
A categorized, draggable palette of node templates that a user can drop onto a sibling SfDiagram.
Implements
Inherited Members
Namespace: Syncfusion.Maui.Diagram
Assembly: Syncfusion.Maui.Diagram.dll
Syntax
public class SymbolPalette : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider
Remarks
Declared as its own sibling element in the developer's layout — e.g. a Grid.Column next to an
SfDiagram — exactly like Xamarin.Forms' Syncfusion.SfDiagram.XForms.Stencil and
EJ2 Diagram's own <ejs-symbolpalette>. Two earlier revisions of this library gave this
control real rendering surface of its own (first as a plain property on SfDiagram, then as
a fully independent control with its own HybridWebView/palette.html page and a hand-built
cross-WebView drag-and-drop protocol). Both were abandoned: EJ2's own SymbolPalette only drags a
symbol onto a diagram by walking up the DOM from the drop point for an ancestor carrying the
"e-diagram" class and reaching into that element's own ej2_instances[0] registry directly
(verified against ej2.min.js) — which only works when both widgets render into the very same
document. Two separate HybridWebViews never share one, and WebView2 itself doesn't reliably
support drag-and-drop across separate instances (see
https://github.com/dotnet/maui/issues/9983,
https://github.com/microsoft/microsoft-ui-xaml/issues/10576), so even a native
pointer-forwarding workaround only ever addressed one platform.
This revision instead has SfDiagram own a single shared page containing both a
#symbolpalette and a #diagram element (see Resources/Raw/wwwroot/index.html), and
construct both ej.diagrams.SymbolPalette and ej.diagrams.Diagram instances there. EJ2's own
built-in same-document drag-and-drop then handles everything — no custom C#/JS drag protocol at all.
This class therefore holds no WebView, no bridge, and no manager: it is a plain bindable-property
carrier. SfDiagram discovers a SymbolPalette placed as its own layout sibling
(see SfDiagram's own remarks) with no reference property needed either way, reads this
class's properties to build the shared page's palette configuration, and re-reads them whenever
Syncfusion.Maui.Diagram.SymbolPalette.Changed fires. Because this control renders nothing itself, any WidthRequest/
HeightRequest (or Grid row/column size) assigned to it in XAML is not reflected anywhere — the
rendered palette panel's size comes entirely from the shared page's own CSS.
Constructors
SymbolPalette()
Initializes a new instance of the SymbolPalette class.
Declaration
public SymbolPalette()
Fields
EnableSearchProperty
Identifies the EnableSearch bindable property.
Declaration
public static readonly BindableProperty EnableSearchProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ExpandModeProperty
Identifies the ExpandMode bindable property.
Declaration
public static readonly BindableProperty ExpandModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
PalettesProperty
Identifies the Palettes bindable property.
Declaration
public static readonly BindableProperty PalettesProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SymbolHeightProperty
Identifies the SymbolHeight bindable property.
Declaration
public static readonly BindableProperty SymbolHeightProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SymbolWidthProperty
Identifies the SymbolWidth bindable property.
Declaration
public static readonly BindableProperty SymbolWidthProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Properties
EnableSearch
Gets or sets whether the palette shows a search box for filtering symbols by name. Defaults to false.
Declaration
public bool EnableSearch { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ExpandMode
Gets or sets whether more than one category can be expanded at once. Defaults to Multiple.
Declaration
public DiagramPaletteExpandMode ExpandMode { get; set; }
Property Value
| Type |
|---|
| DiagramPaletteExpandMode |
Palettes
Gets or sets the palette's categories. Empty by default. Each category's
Symbols reuses Node — EJ2's own
PaletteModel.symbols is just a list of node definitions, the same JSON shape
Nodes already uses.
Declaration
public ObservableCollection<Palette> Palettes { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<Palette> |
SymbolHeight
Gets or sets a uniform height, in diagram units, applied to every symbol tile. See the remarks on SymbolWidth.
Declaration
public Nullable<double> SymbolHeight { get; set; }
Property Value
| Type |
|---|
| System.Nullable<System.Double> |
SymbolWidth
Gets or sets a uniform width, in diagram units, applied to every symbol tile in the palette. Defaults to null, which leaves each Width as-is.
Declaration
public Nullable<double> SymbolWidth { get; set; }
Property Value
| Type |
|---|
| System.Nullable<System.Double> |