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 5934755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:09:29+00:00 2026-05-22T15:09:29+00:00

I have a Main WPF application and other modules and I am using PRISM

  • 0

I have a Main WPF application and other modules and I am using PRISM to host the view of the modules in different regions defined in my Shell. This works fine for me.
I now have a requirement to set my Main application as class library and invoke it from another Window Application.
This new Window application has a Main function with the following code.

[System.STAThreadAttribute()]
    public static void Main()
    {
        Application app = new Application();
        IStartupUI start = new StartupUI();
        start.StartUserInterface();                      
        app.Run();
    }

The start.StartUserInterface basically calls the function in the dll which has following code

     ABCBootStrapper bootstrapper = new ABCBootStrapper ();
     bootstrapper.Run();

The same piece of code was earlier called in OnStartup when the Dll itself was the main application.

Now with this change the Shell does not show any view. On debugging I found that the RegionManager does not recognize any regions that are defined in the Shell. Basically number of regions registered with RegionManager are 0.
All the regions defined in the shell are ContentControl.

  • 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-22T15:09:30+00:00Added an answer on May 22, 2026 at 3:09 pm

    My problem seemed to have been solved by doing the following:

    I made the class which contains the Main function derive from System.Windows.Application
    and instead of directly creating the instance of Application I created the instance of the class and I put the code for starting the user interface into the OnStartup event handler.

    class Test : System.Windows.Application
    {
        [System.STAThreadAttribute()]
        public static void Main()
        {
            Test app = new Test();
            app.Startup += new StartupEventHandler(app_Startup);
            app.Run();
        }
    
        static void app_Startup(object sender, StartupEventArgs e)
        {
    
            IStartupUI start = new StartupUI();
            start.StartUserInterface();
    
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have WPF Application where I have One main form and other user controls
I have a wpf application in mvvm pattern. In main view, I have few
I have the following problem: Multithreaded WPF application, Model View Presenter Implementation. Presenters and
I'm writting an WPF application using the mvvm toolkint. In the main windows I
I'm using MVVM in my WPF application. I have a Window that has a
I have a WPF application with the main Window class called MainWindow. Since I
I have a WPF database viewer application: It's a simple main window containing a
I'm writing an application in WPF. I have one main thread and another one
We have a WinForms application that we are progressively converting to WPF. At this
I have one WrapPanel With name PageWrapPanel In Main window of my WPF application

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.