Show modal forms on startup of your XAF web application

Sometimes your want to show some kind of modal dialog instantly after the user logged into the XAF web application. An easy way to do so is to inherit a class from the “WebShowStartupNavigationItemController” and override the “ShowStartupNavigationItem” method therein:

public class CustomWebShowStartupNavigationItemController : WebShowStartupNavigationItemController
    {
        protected override void ShowStartupNavigationItem()
        {
            base.ShowStartupNavigationItem();

            var currentUser = SecuritySystem.CurrentUser as Users;
            if (!currentUser.ShowTheMessageBox)
            {
               IObjectSpace os = Application.CreateObjectSpace();
               object theObjectToBeShown = os.FindObject<Users>(null);
               DetailView dv = Application.CreateDetailView(os, theObjectToBeShown, true);
               dv.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.Edit;
               DialogController dc = Application.CreateController<DialogController>();
               Window popupWindow = Application.CreatePopupWindow(TemplateContext.PopupWindow, null, dc);
               popupWindow.SetView(dv);
               ((WebApplication)Application).PopupWindowManager.ShowPopup((WebWindow)popupWindow, (WebWindow)Window);
               // ...

Combined with the technique described in the Using non persistent objects to display modal dialogs topic any content can be shown in those modal dialogs.