alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class SfDialogProvider

    The DialogProvider component serves as a target container where built-in dialogs are rendered using ConfirmAsync(string, string, DialogOptions), AlertAsync(string, string, DialogOptions), and PromptAsync(string, string, DialogOptions) methods from the SfDialogService.

    Inheritance
    object
    ComponentBase
    SfDialogProvider
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.Popups
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfDialogProvider : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender
    Remarks

    It is recommended to add this component in MainLayout.razor to enable utility dialogs to be displayed from anywhere in the application. If you add this component to a specific page, the utility dialogs will only be available for that particular page. The component automatically handles the lifecycle of dialogs created through the SfDialogService, including their opening, closing, and result handling.

    Examples

    Adding the DialogProvider component to your application layout.

    @* In MainLayout.razor *@
    <div class="page">
        <div class="sidebar">
            <NavMenu />
        </div>
        <main>
            <div class="top-row px-4">
                <a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
            </div>
            <article class="content px-4">
                @Body
            </article>
        </main>
    </div>
    <SfDialogProvider />

    Constructors

    SfDialogProvider()

    Declaration
    public SfDialogProvider()

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    Dispose()

    Releases all resources used by the SfDialogProvider component.

    Declaration
    public void Dispose()
    Remarks

    This method unsubscribes from the Syncfusion.Blazor.Popups.SfDialogService.OnOpen event to prevent memory leaks. It is automatically called when the component is disposed by the Blazor framework.

    OnInitialized()

    Initializes the component and subscribes to the dialog service events.

    Declaration
    protected override void OnInitialized()
    Overrides
    ComponentBase.OnInitialized()
    Remarks

    This method is called once when the component is first initialized. It subscribes to the Syncfusion.Blazor.Popups.SfDialogService.OnOpen event to handle dialog requests from the service.

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved