Show Dialog with full screen in Blazor Dialog Component

7 Aug 20231 minute to read

You can show the dialog in full screen by passing true as argument to the dialog Show method. By using the 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();