Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prism App Does Not Exit When Closed

Tags:

wpf

prism

I am learning prism and I have hit a problem.

I have made an app very similar to the one that Mike Taulty makes in is great tutoral about Prism. The biggest difference is that my app is a WPF app instead of Silverlight.

I am finding that I have hit a problem though. When I close the main shell window, the app does not exit. The window goes a way, but the debugger is still active.

I have tried looking for call stacks and such, but Visual Studio just tells me that it is "External Code".

Any ideas on what I can do/look for to fix this?

like image 349
Vaccano Avatar asked Jan 21 '23 03:01

Vaccano


1 Answers

Override the OnStartup method in the code behind of your App.xaml, and add this:

this.ShutdownMode = ShutdownMode.OnMainWindowClose; 

HTH

like image 190
Dyer Avatar answered Mar 23 '23 20:03

Dyer