New Posts New Posts RSS Feed: Silverlight Application Exit
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Silverlight Application Exit

 Post Reply Post Reply
Author
rickadams View Drop Down
Newbie
Newbie
Avatar

Joined: 04-Mar-2011
Posts: 12
Post Options Post Options   Quote rickadams Quote  Post ReplyReply Direct Link To This Post Topic: Silverlight Application Exit
    Posted: 24-Jun-2011 at 10:00am
I would like to perform a Session Logout before my Silverlight OOB application exits. I need to handle both the Close Button event as well as the user closing the Application from the taskbar. The DevForce Async calls are not executed in Application_Exit. Because I am also persisting the Entity managers to Isolated Storage in Application_Exit the Session Logout update is actually performed the next time I startup the application and the EntityManager is restored from IS. is there any way I can do this Session Logout update before the Application actually exits.
 
Thanks
 
Rick Adams
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 27-Jun-2011 at 10:17am
Rick,

From my research, it looks like this is a limitation with Silverlight, and thus is something that we can't handle in DevForce. It looks like it has to do with how calls are queued inside the UI thread. Have you tried putting your async code into a separate thread and locking your current thread until that has completed? I don't think that the application can exit until the UI thread is no longer locked. In your case, you may want to combine this with a MessageBox, telling the user that the application is exiting and that it may take a moment, rather than letting them think it's timed out.

Yours,
Robert
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 27-Jun-2011 at 3:06pm
Try doing it from the Application.MainWindow.Closing event, you can then execute your required code.
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 27-Jun-2011 at 3:13pm
I'll have to try that out. Thanks, Mark!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down