Class SpinnerEventArgs
Represents the event arguments for the OnBeforeOpen and OnBeforeClose events of the Syncfusion.Blazor.Spinner.SfSpinner component.
Inheritance
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 |
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.