Class SyncfusionBlazorToolkitService
Provides global runtime state and configuration for Syncfusion Blazor Toolkit components, including RTL settings, animation preferences, and device-mode detection caching.
Inheritance
Namespace: Syncfusion.Blazor.Toolkit
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public class SyncfusionBlazorToolkitService : Object
Remarks
Registered as a scoped service during application startup by AddSyncfusionBlazorToolkit(IServiceCollection, Action<GlobalOptions>). Derived components access this service to read global options and share one-time initialization state (for example, the in-process JavaScript runtime flag).
Constructors
SyncfusionBlazorToolkitService(IOptions<GlobalOptions>)
Provides global runtime state and configuration for Syncfusion Blazor Toolkit components, including RTL settings, animation preferences, and device-mode detection caching.
Declaration
public SyncfusionBlazorToolkitService(IOptions<GlobalOptions> configure)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Extensions.Options.IOptions<Syncfusion.Blazor.Toolkit.GlobalOptions> | configure |
Remarks
Registered as a scoped service during application startup by AddSyncfusionBlazorToolkit(IServiceCollection, Action<GlobalOptions>). Derived components access this service to read global options and share one-time initialization state (for example, the in-process JavaScript runtime flag).
Methods
EnableRtl(Boolean)
Enables or disables right-to-left (RTL) text direction for all supported Syncfusion Blazor Toolkit components in this application scope.
Declaration
public void EnableRtl(bool enable = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | enable | true to enable RTL layout; false to disable it. The default is true. |
Remarks
This method modifies the global options instance. It is equivalent to setting Syncfusion.Blazor.Toolkit.GlobalOptions.EnableRtl directly. The change takes effect for components rendered after the call.
IsAnimationEnabled()
Determines whether component animations are enabled globally based on the current Syncfusion.Blazor.Toolkit.GlobalOptions.Animation setting.
Declaration
public bool IsAnimationEnabled()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if animation is enabled (either Default or Enable); false if disabled. |
Remarks
Individual components reference this method before running animation transitions so that a single global switch can turn animations on or off everywhere.
Examples
if (Service.IsAnimationEnabled())
{
await AnimateAsync();
}