Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7445481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:49:52+00:00 2026-05-29T11:49:52+00:00

I use Prism for a appliction and need a login dialog. For the login

  • 0

I use Prism for a appliction and need a login dialog. For the login to be verified i need to initialize some of the application data that is loaded by Prism/MEF so i cant put it in App.xmal.cs
OnStartUp so i put the login dialog in the bootstrappers InitializeShell like this

   protected override void InitializeShell()
        {


            Application.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;

            //// Authenticate the current user and set the default principal
            LoginDialog auth = new LoginDialog();
            auth.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            bool? dialogResult = auth.ShowDialog();

            // deal with the results
            if (dialogResult.HasValue && dialogResult.Value)
            {

                base.InitializeShell();
                Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;

            }
            else
            {
                Application.Current.Shutdown(-1);
            }


#if SILVERLIGHT
            Application.Current.RootVisual = (Shell)this.Shell;            
#else
            Application.Current.MainWindow = (Shell)this.Shell;


            Application.Current.MainWindow.Show();
#endif
        }

I have a hard time assessing if there are any traps or drawback, anyone have a comment

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:49:59+00:00Added an answer on May 29, 2026 at 11:49 am

    Yes, I had exactly same dilemma. You have only one RootVisual and yet you have to force user to login. It’s a common scenario that’s not really addressed.

    Here is what I did:

    1. Code like you don’t have Login. Initialize shell and load first module. In my case first module contains security stuff.

    2. When your “System” or whatever you call it module loaded – write code in Initialize() to call your login procedure, in my case this is SecurityService.

    3. I used RegionPopupManager (example in StockTrader RI project bundled with PRISM) to show modal popup interaction.

    4. When logged in – just hide popup and proceed loading other modules, populating regions, etc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found that in order to use PRISM's classes in XAML you need to
Are there any sample applications avaliable that make use of both caliburn and prism?
I've created some simple custom ModuleManager in my silverlight application based on PRISM. I
I'm trying to use Prism and the MVVM pattern to develop an application. In
I'm studying Prism and need to create a small demo app. I have some
I am making a Prism desktop application and intend to use WCF services to
I am developing a WPF application making use of PRISM along the way. I
I am writing an application ( WPF ) where i use the prism framework.
I have a WPF application that is written using MVVM Prism. It has a
I just started learning Prism and trying to use it with MEF in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.