Class SfBaseComponent
Base class for all Syncfusion Blazor Toolkit components, centralizing lifecycle logic, JavaScript interop abstraction, property-change tracking, and shared module imports.
Inheritance
Implements
Namespace: Syncfusion.Blazor.Toolkit
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public abstract class SfBaseComponent : ComponentBase, IAsyncDisposable
Remarks
Derived components must inherit from SfBaseComponent to receive:
- Automatic property-change tracking via Syncfusion.Blazor.Toolkit.SfBaseComponent.NotifyPropertyChanges``1(System.String,``0,``0).
- Runtime-agnostic JavaScript interop through Syncfusion.Blazor.Toolkit.SfBaseComponent.InvokeVoidAsync(Microsoft.JSInterop.IJSObjectReference,Microsoft.JSInterop.IJSInProcessObjectReference,System.String,System.Object[]) and Syncfusion.Blazor.Toolkit.SfBaseComponent.InvokeAsync``1(Microsoft.JSInterop.IJSObjectReference,Microsoft.JSInterop.IJSInProcessObjectReference,System.String,System.Object[]).
- Lazy loading of shared JS modules (base, animation, draggable, popup, touch).
- Touch-device detection and static-server rendering awareness.
Constructors
SfBaseComponent()
Declaration
protected SfBaseComponent()
Methods
DisposeAsync()
Releases unmanaged resources, JavaScript module references, and DotNet object references for this component.
Declaration
public ValueTask DisposeAsync()
Returns
| Type |
|---|
| System.Threading.Tasks.ValueTask |
Remarks
The base implementation clears Syncfusion.Blazor.Toolkit.SfBaseComponent.PropertyChanges, disposes each imported JS module (Syncfusion.Blazor.Toolkit.SfBaseComponent._baseJsModule, Syncfusion.Blazor.Toolkit.SfBaseComponent._animationJsModule,
A Microsoft.JSInterop.JSDisconnectedException is caught and ignored because the circuit may disconnect (page reload) before JS disposal completes.
Derived components that hold additional disposable resources should override Syncfusion.Blazor.Toolkit.SfBaseComponent.DisposeAsyncCore() rather than replacing this method.