menu

Blazor

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

    Show / Hide Table of Contents

    Class SpinnerEventArgs

    Represents the event arguments for the OnBeforeOpen and OnBeforeClose events of the Syncfusion.Blazor.Spinner.SfSpinner component.

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

    These events 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 the SpinnerEventArgs in an event handler to cancel the spinner's visibility change.

    <SfSpinner @bind-Visible="@IsVisible" >
        <SpinnerEvents OnBeforeOpen="BeforeOpenHandler"></SpinnerEvents>
    </SfSpinner>
    @code {
        private bool IsVisible { get; set; } = true;
        private void BeforeOpenHandler(SpinnerEventArgs args)
        {
            // Cancels the spinner from being shown
            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

    A bool value. If set to true, the spinner's visibility change is prevented. The default value is false.

    Remarks

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

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