Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxPopupBase.Shown Event

Fires after the Popup is displayed.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<PopupShownEventArgs> Shown { get; set; }

#Event Data

The Shown event's data class is PopupShownEventArgs. The following properties provide information specific to this event:

Property Description
CancellationToken Specifies an object that propagates a cancellation notification.

#Remarks

Handle the Shown event to process show actions. This event occurs in the following cases:

You can also handle the Showing event that fires before the Popup is displayed and allows you to cancel this action. To process close actions, handle the Closing and Closed events.

The following example allows users to show the Popup only after they enable the checkbox:

Razor
<div>
    <DxCheckBox @bind-Checked="@Checked">
        Allow Popup
    </DxCheckBox>
    @*...*@
    <DxButton RenderStyle="ButtonRenderStyle.Primary" Text="Show"
              Click="() => PopupVisible = true"/>
</div>

<DxPopup @bind-Visible="@PopupVisible"
         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."
         Showing="PopupShowing"
         Shown="PopupShown">
</DxPopup>
@code {
    bool Checked { get; set; }
    bool PopupVisible { get; set; }

    void PopupShowing(PopupShowingEventArgs args) {
        args.Cancel = !Checked;
    }

    void PopupShown(PopupShownEventArgs args) {
        Checked = false;
    }
}
See Also