views:

21

answers:

1

i am making a wpf application in which there is a main window. normally when i close the main window the program used to terminate automatically but now it doesn't. altough the window is closed the program still seems to be running in visual studio. how can i fix this simple problem?

A: 

Check the value of ShutdownMode on Application.Current. You may have it set to OnExplicitShutdown, in which case it's waiting for you to call Shutdown. The default is OnLastWindowClose, but you may have changed it in App.xaml or at runtime.

If not, then you still have a window open. You can look at Application.Windows to find open windows and try to find why they haven't closed.

Quartermeister