jeudi 17 avril 2014

.net - c# poursuivre et terminer l'exécution de code après la sortie d'application wpf - Stack Overflow


Background: I am working on a c# WPF application where, at some stage, user instructs the application to do some work. The work may take substantial amount of time and the user may not wish for the work to be completed and may exit the WPF application - with the intention of returning at a later time to review the results - which the application gets from a DB.


Question: Looking for is a way for the WPF application to finish the work - regardless of whether the WPF application has exited or not.


Choice 1: I could write a worker application that does the work - and start a process from my WPF application that executes this worker application.


Choice 2: Spawn a thread / backgroundwoker that does the work. This would have the additional advantage of presenting the results to the user, should the application still be active.


I would much prefer choice 2, if it were feasible. Would appreciate any advice - other alternatives, things to watch, relevant links etc. Almost all links I have seen are focused on successfully terminating threads prior to application exit, and none that I have found talks of the opposite scenario.



Background: I am working on a c# WPF application where, at some stage, user instructs the application to do some work. The work may take substantial amount of time and the user may not wish for the work to be completed and may exit the WPF application - with the intention of returning at a later time to review the results - which the application gets from a DB.


Question: Looking for is a way for the WPF application to finish the work - regardless of whether the WPF application has exited or not.


Choice 1: I could write a worker application that does the work - and start a process from my WPF application that executes this worker application.


Choice 2: Spawn a thread / backgroundwoker that does the work. This would have the additional advantage of presenting the results to the user, should the application still be active.


I would much prefer choice 2, if it were feasible. Would appreciate any advice - other alternatives, things to watch, relevant links etc. Almost all links I have seen are focused on successfully terminating threads prior to application exit, and none that I have found talks of the opposite scenario.


0 commentaires:

Enregistrer un commentaire