Show Dialog with fullscreen in Blazor Dialog Component

2 Aug 20211 minute to read

You can show the dialog in fullscreen by passing true as argument to the dialog Show method. By using Visible property you can prevent the dialog from showing initially.

@using Syncfusion.Blazor.Popups
@using Syncfusion.Blazor.Buttons

<SfButton @onclick="@OpenDialog">Open FullScreen Dialog</SfButton>

<SfDialog @ref="DialogRef" Width="250px" ShowCloseIcon="true" Visible="false">
        <Header> Dialog </Header>
        <Content> This is a Dialog with button and primary button </Content>
        <DialogButton Content="OK" IsPrimary="true" OnClick="@CloseDialog" />
        <DialogButton Content="Cancel" OnClick="@CloseDialog" />

@code {
    SfDialog DialogRef;

    private async Task OpenDialog()
        await this.DialogRef.ShowAsync(true);

    private async Task CloseDialog()
        await this.DialogRef.HideAsync();