Class SpinnerEvents
Configures the event handlers for the Syncfusion.Blazor.Spinner.SfSpinner component.
Inherited Members
Namespace: Syncfusion.Blazor.Spinner
Assembly: Syncfusion.Blazor.dll
Syntax
public class SpinnerEvents : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
The SpinnerEvents allows you to handle various events triggered by the Syncfusion.Blazor.Spinner.SfSpinner, such as its creation, opening, and closing.
Examples
A simple example of using SpinnerEvents.
<SfSpinner>
<SpinnerEvents Created="@SpinnerCreated" OnBeforeOpen="@SpinnerBeforeOpen" OnBeforeClose="@SpinnerBeforeClose" Destroyed="@SpinnerDestroyed"></SpinnerEvents>
</SfSpinner>
@code {
private void SpinnerCreated(object args)
{
// Handle the created event
}
private void SpinnerBeforeOpen(SpinnerEventArgs args)
{
// Handle the before open event
}
private void SpinnerBeforeClose(SpinnerEventArgs args)
{
// Handle the before close event
}
private void SpinnerDestroyed(object args)
{
// Handle the destroyed event
}
}
Constructors
SpinnerEvents()
Declaration
public SpinnerEvents()
Properties
Created
Gets or sets an event callback that triggers after the Syncfusion.Blazor.Spinner.SfSpinner is created.
Declaration
[Parameter]
public EventCallback<object> Created { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<object> | An EventCallback<TValue> of type object. The default value is |
Remarks
This event can be used to perform actions once the spinner is initialized.
Destroyed
Gets or sets an event callback that triggers after the Syncfusion.Blazor.Spinner.SfSpinner is destroyed.
Declaration
[Parameter]
public EventCallback<object> Destroyed { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<object> | An EventCallback<TValue> of type object. The default value is |
Remarks
This event can be used to perform cleanup actions after the spinner has been removed from the DOM.
OnBeforeClose
Gets or sets an event callback that triggers before the Syncfusion.Blazor.Spinner.SfSpinner is closed.
Declaration
[Parameter]
public EventCallback<SpinnerEventArgs> OnBeforeClose { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SpinnerEventArgs> | An EventCallback<TValue> that is invoked before the spinner is hidden. The callback receives a SpinnerEventArgs. |
Remarks
This event allows you to execute custom logic before the spinner is hidden from the view.
OnBeforeOpen
Gets or sets an event callback that triggers before the Syncfusion.Blazor.Spinner.SfSpinner is opened.
Declaration
[Parameter]
public EventCallback<SpinnerEventArgs> OnBeforeOpen { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<SpinnerEventArgs> | An EventCallback<TValue> that is invoked before the spinner is shown. The callback receives a SpinnerEventArgs. |
Remarks
You can use this event to perform actions or cancel the opening of the spinner by setting the Cancel property of the SpinnerEventArgs to true.
Methods
Dispose()
Releases the unmanaged resources used by the SpinnerEvents component.
Declaration
public virtual void Dispose()
Remarks
This method is called to dispose of the component and its resources.
Dispose(bool)
Releases the unmanaged resources used by the SpinnerEvents, and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
|
Overrides
Remarks
This protected method is called to perform the actual resource cleanup. It nullifies the reference to the parent component.
OnInitializedAsync()
Method invoked when the component is ready to start and receives its initial parameters.
Declaration
protected override Task OnInitializedAsync()
Returns
| Type | Description |
|---|---|
| Task | A Task representing any asynchronous operation. |
Overrides
Remarks
This method assigns the current instance of SpinnerEvents to the parent Syncfusion.Blazor.Spinner.SfSpinner component.