Back to Devexpress

ModuleBase.GetStartupActions() Method

expressappframework-devexpress-dot-expressapp-dot-modulebase-5dea3cd4.md

latest4.1 KB
Original Source

ModuleBase.GetStartupActions() Method

Returns a list of Pop-up Window Show Actions that must be executed before loading the application’s main Window.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public virtual IList<PopupWindowShowAction> GetStartupActions()
vb
Public Overridable Function GetStartupActions As IList(Of PopupWindowShowAction)

Returns

TypeDescription
IList<PopupWindowShowAction>

An IList<PopupWindowShowAction> object that represents a collection of Actions to be executed before invoking the application’s main Window.

|

Remarks

Override this method to return a custom list of Pop-up Window Show Actions to be executed when the application is starting up. In the following example, an Action that shows the BusinessObject1 List View is added.

csharp
using DevExpress.ExpressApp.Actions;
// ...
public override IList<PopupWindowShowAction> GetStartupActions() {
    List<PopupWindowShowAction> actions = new List<PopupWindowShowAction>(base.GetStartupActions());
    IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(BusinessObject1));
    PopupWindowShowAction startupAction = new PopupWindowShowAction();
    startupAction.CustomizePopupWindowParams += 
        delegate(Object sender, CustomizePopupWindowParamsEventArgs e) {
        e.View = Application.CreateListView(objectSpace, typeof(BusinessObject1), true);
    };
    actions.Add(startupAction);
    return actions;
}

If your XAF WinForms application uses the Security System and requires users to log in, the Overlay Form covers the Logon Form after the user clicks the Log In button and until the Main Window loads. If any startup Actions are available, the Actions show forms while the Logon Form and the Overlay Form are displayed.

You can close the Logon Form after the user clicks Log In and then perform startup Actions. To do this, access the WinForms Application project‘s WinApplication.cs (WinApplication.vb) file and set the ExecuteStartupLogicBeforeClosingLogonWindow property to false :

csharp
namespace MySolution.Win {
    public partial class MySolutionWindowsFormsApplication : WinApplication {
        public MySolutionWindowsFormsApplication() {
            // ...
            ExecuteStartupLogicBeforeClosingLogonWindow = false;
        }
        // ...
    }
}

To disable the Overlay Form, you can deactivate all built-in splash forms or use a constructor that does not enable the Overlay Form.

See Also

ModuleBase Class

ModuleBase Members

DevExpress.ExpressApp Namespace