menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PaletteExpandingEventArgs - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PaletteExpandingEventArgs

    Notifies when the palette items are expanded or collapsed in the symbol palette.

    Inheritance
    System.Object
    PaletteExpandingEventArgs
    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

    true to cancel the expand/collapse operation; otherwise, false. The default value is false.

    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

    true if the palette item is expanded; otherwise, false. The default value is false.

    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 null if no palette is associated.

    Examples
    <SfSymbolPaletteComponent Expanding="OnExpanding">
    </SfSymbolPaletteComponent>
    
    private void OnExpanding(PaletteExpandingEventArgs args)
    {
        Palette currentPalette = args.Palette;
        // Access palette properties
        string paletteId = currentPalette?.Id;
    }

    See Also

    PaletteExpandingEventArgs
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved