alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class SpinnerEventArgs

    Represents the event arguments for the OnOpen and OnClose events of the SfSpinner component.

    Inheritance
    System.Object
    SpinnerEventArgs
    Namespace: Syncfusion.Blazor.Toolkit.Spinner
    Assembly: Syncfusion.Blazor.Toolkit.dll
    Syntax
    public class SpinnerEventArgs : Object
    Remarks

    These event arguments enable you to conditionally prevent the spinner from being shown or hidden by setting the Cancel property to true. This allows for custom logic to control the spinner's visibility based on application state or other conditions.

    Examples

    The following example demonstrates how to use SpinnerEventArgs in an event handler to cancel the spinner's visibility change.

    <SfSpinner @bind-Visible="@IsVisible" OnBeforeOpen="HandleBeforeOpenAsync">
    </SfSpinner>
    @code {
        private bool IsVisible { get; set; } = true;
    
        private void HandleBeforeOpenAsync(SpinnerEventArgs args)
        {
            // Cancel the spinner from being shown based on custom condition
            args.Cancel = true;
        }
    }

    Constructors

    SpinnerEventArgs()

    Declaration
    public SpinnerEventArgs()

    Properties

    Cancel

    Gets or sets a value indicating whether the spinner's visibility change should be canceled.

    Declaration
    public bool Cancel { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to prevent the spinner's visibility change; otherwise, false. The default value is false.

    Remarks

    This property is evaluated by the component after the OnOpen or OnClose event is raised. Setting it to true stops the spinner from being shown or hidden.

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