Back to Devexpress

WindowShowingEventArgs Class

blazor-devexpress-dot-blazor-57fa5733.md

latest2.9 KB
Original Source

WindowShowingEventArgs Class

Contains data for the Showing event.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public class WindowShowingEventArgs :
    CancelEventArgs

WindowShowingEventArgs is the data class for the following events:

Remarks

The Showing event fires before the Window is displayed in one of the following ways:

Handle the Showing event to process show actions. You can set the event argument’s Cancel property to true to cancel a show action. You can also handle the Shown event that fires after the Window is displayed.

The following example displays the window only after users enable the checkbox:

razor
<div>
    <DxCheckBox @bind-Checked="@Checked">
        Allow Window
    </DxCheckBox>
    @*...*@
    <DxButton RenderStyle="ButtonRenderStyle.Secondary"
          Click="OnShowAtPositionClick">SHOW A WINDOW</DxButton>
</div>

<DxWindow HeaderText="Header"
          BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet metus vel
             nisi blandit tincidunt vel efficitur purus. Nunc nec turpis tempus, accumsan orci auctor,
             imperdiet mauris. Fusce id purus magna."
          Width="max(25vw, 250px)"
          @ref=WindowRef
          Showing="WindowShowing"
          Shown="WindowShown">
</DxWindow>

@code {
    DxWindow WindowRef;
    bool Checked { get; set; }
    bool WindowVisible { get; set; }

    void WindowShowing(WindowShowingEventArgs args) {
        args.Cancel = !Checked;
    }

    void WindowShown(WindowShownEventArgs args) {
        Checked = false;
    }

    async Task OnShowAtPositionClick(MouseEventArgs args) {
        await WindowRef.ShowAtAsync(args.ClientX, args.ClientY);
    }
}

Inheritance

Object EventArgs CancelEventArgs WindowShowingEventArgs

See Also

WindowShowingEventArgs Members

DevExpress.Blazor Namespace