PopupWindowShowAction Class

Represents a Pop-up Window Show Action.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v18.1.dll

Syntax

public class PopupWindowShowAction :
    ActionBase,
    ISupportUpdate,
    ISupportClientScripts

The PopupWindowShowAction class inherits the basic functionality of Actions from the ActionBase class. Pop-up Window Show Actions are used to invoke a pop-up Window with a specified View and execute custom code when an end-user clicks the accept or cancel button. To specify the View to be displayed, handle the PopupWindowShowAction.CustomizePopupWindowParams event and set the required View to the handler's CustomizePopupWindowParamsEventArgs.View parameter. An example of using this approach is shown below.

public class ShowPopupViewController : ObjectViewController<ObjectView, DemoObject> {
    public ShowPopupViewController() {
        new PopupWindowShowAction(this, "ShowPopup", 
PredefinedCategory.View).CustomizePopupWindowParams += (s, e) => {
            IObjectSpace objectSpace = e.Application.CreateObjectSpace(typeof
(PopupInfoDemoObject));
            DetailView detailView = e.Application.CreateDetailView(objectSpace, 
new PopupInfoDemoObject(ViewCurrentObject));
            detailView.ViewEditMode = ViewEditMode.Edit;
            e.View = detailView;
            e.Maximized = true;
        };
    }
}

In the code above, the new PopupWindowShowAction object is created to invoke a pop-up window for the particular View when the PopupWindowShowAction.CustomizePopupWindowParams event raises. The CustomizePopupWindowParamsEventArgs.Maximized property is set to true, thus the pop-up window will expand to occupy the whole space.

To process end-user clicks on the accept and cancel buttons, handle the PopupWindowShowAction.Execute and PopupWindowShowAction.Cancel events, respectively. Built-in Action Containers display Pop-up Window Show Actions via a button.

To add a Pop-up Window Show Action to a Controller, drag and drop the PopupWindowShowAction item from the XAF Actions section on the Toolbox to the required Controller's Designer area (see Add an Action that Displays a Pop-up Window). You can also use the ActionAttribute to convert a business class' method to an Action that displays a non-persistent object in a popup (see How to: Create an Action Using the Action Attribute).

Note

Unlike other Action types, the PopupWindowShowAction does not raise the ActionBase.ProcessCreatedView event. This is because such an Action creates a View before the Executed event is raised.

Inheritance

Object
ActionBase
PopupWindowShowAction

Implements

Extension Methods

See Also