Hi, I am calling Application.Current.Shutdown method from class that is binded to xaml windows with objectdataprovider, but the application is not closing, can anyone help me to understand why? And i note that my application is not closing completely after my main window is closed, it doesn't disappear from task manager's process list. Thanks a lot.
+2
A:
Have you created any threads to do background processing? If you have, make sure to set the .IsBackground
property on them, or they can keep the app running
Orion Edwards
2009-05-01 08:15:22
No, i doesn't create threads directly, may be WPF do bindings or objectdataprovider resources in other thread?
ArsenMkrt
2009-05-01 08:39:06
+1
A:
If you have multiple windows or dialogs in your application, you may need to close each one explicitly.
Close dialogs with:
_myDialog.Close();
Close all windows:
for(int i = 0; i < Application.Current.Windows.Count; i++)
{
Application.Current.Windows[i].Close();
}
Steven Richards
2009-05-01 09:16:57
I try this, it doesn't help, i realize where is the problem, the problem is that when i call shutdown() or close() the objectdataprovider execution is not terminated, I think it will be better to add a new question, what I will do now :)
ArsenMkrt
2009-05-01 10:16:13
surely you could replace the for(i...) with a foreach? manually iterating over loops is so last century :-)
Orion Edwards
2009-05-03 20:37:18