Class PaletteExpandingEventArgs
Notifies when the palette items are expanded or collapsed in the symbol palette.
Inheritance
Namespace: Syncfusion.Blazor.Diagram.SymbolPalette
Assembly: Syncfusion.Blazor.dll
Syntax
public class PaletteExpandingEventArgs : Object
Remarks
This event is triggered before the expand/collapse action occurs and can be cancelled by setting the Cancel property.
Examples
<SfSymbolPaletteComponent Expanding="OnExpanding">
</SfSymbolPaletteComponent>
private void OnExpanding(PaletteExpandingEventArgs args)
{
// Cancel expansion based on condition
if (someCondition)
{
args.Cancel = true;
}
}
Constructors
PaletteExpandingEventArgs()
Declaration
public PaletteExpandingEventArgs()
Properties
Cancel
Gets or sets a value indicating whether the palette item expand or collapse operation should be canceled.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
<SfSymbolPaletteComponent Expanding="OnExpanding">
</SfSymbolPaletteComponent>
private void OnExpanding(PaletteExpandingEventArgs args)
{
// Cancel expansion based on condition
if (someCondition)
{
args.Cancel = true;
}
}
Index
Gets or sets the index of the palette item being expanded or collapsed.
Declaration
public int Index { get; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer representing the zero-based index of the palette item. |
Examples
<SfSymbolPaletteComponent Expanding="OnExpanding">
</SfSymbolPaletteComponent>
private void OnExpanding(PaletteExpandingEventArgs args)
{
int paletteIndex = args.Index;
// Process specific palette at index
}
IsExpanded
Gets or sets a value indicating whether the palette item is expanded.
Declaration
public bool IsExpanded { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
<SfSymbolPaletteComponent Expanding="OnExpanding">
</SfSymbolPaletteComponent>
private void OnExpanding(PaletteExpandingEventArgs args)
{
bool currentState = args.IsExpanded;
// Check or modify expansion state
if (!currentState)
{
args.IsExpanded = true;
}
}
Palette
Gets or sets the palette item that is being expanded or collapsed.
Declaration
public Palette Palette { get; }
Property Value
Type | Description |
---|---|
Palette | A Palette object representing the palette item, or |
Examples
<SfSymbolPaletteComponent Expanding="OnExpanding">
</SfSymbolPaletteComponent>
private void OnExpanding(PaletteExpandingEventArgs args)
{
Palette currentPalette = args.Palette;
// Access palette properties
string paletteId = currentPalette?.Id;
}