Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Bootstrapper causes other UI frozen

$
0
0
Hi All,

I am using Prism 4.1 and WPF MVVM as my base app platform. I have a login window with a busy indicator control. I am using BackgroundWorker class so that user can see the busy indicator when prism is loading all modules.

code snippets look like below:
var backgroundWorker = new BackgroundWorker();
backgroundWorker.DoWork += OnBackgroundWorkerDoWork;
backgroundWorker.RunWorkerAsync();

public void OnBackgroundWorkerDoWork(object sender, DoWorkEventArgs e)
{ 
    Bootstrapper bootstrapper = new Bootstrapper();
    bootstrapper.Run();
} 
However, when the bootstrapper is running, the login window is frozen. Why? how to work around this?

I also tried Application.Current.Dispatcher.BeginInvoke to run Bootstrapper but no luck.

Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new LoginDelegate(Login));

Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>