locked
How to restart a Win8/WinRT application?

    Question

  • Hello guys,

    I have an application in which different profiles are used for different targets.

    A feature was just added to switch between profiles, but this requires the app to restart, and I don't know how to do it from within a Windows RT app.

    If anyone has faced this before, I would really appreciate any help or suggestions.

    Thanks in advance!

    Friday, January 25, 2013 2:31 AM

Answers

  • There isn't a way to programmatically restart the app. That can be done only by the user.

    You shouldn't need to restart the whole app to update the profiles. You should be able to just refresh the current page. The easiest way is probably to persist any data stored on the page (like you do to survive suspending) and then simulate navigating back to it.

    --Rob

    • Proposed as answer by Jesse Jiang Tuesday, January 29, 2013 1:59 AM
    • Marked as answer by Jesse Jiang Wednesday, January 30, 2013 5:42 AM
    Saturday, January 26, 2013 2:48 AM
    Owner

All replies

  • There isn't a way to programmatically restart the app. That can be done only by the user.

    You shouldn't need to restart the whole app to update the profiles. You should be able to just refresh the current page. The easiest way is probably to persist any data stored on the page (like you do to survive suspending) and then simulate navigating back to it.

    --Rob

    • Proposed as answer by Jesse Jiang Tuesday, January 29, 2013 1:59 AM
    • Marked as answer by Jesse Jiang Wednesday, January 30, 2013 5:42 AM
    Saturday, January 26, 2013 2:48 AM
    Owner
  • Thanks, Rob! I guess I'll have to find a way to do what I intended.

    I still believe it would be nice to have an API for restarting an app, since it would ease things for more than one.

    For example, where I work, apps are compound of lots of classes and libraries, each initialized in a given order.

    Unfortunately, I did not code all of them and I do not know how each of them work, I only need to know their purpose, so it takes me a lot of time to figure out how to (destroy and) reinitialize everything.

    Anyway, thanks again, for the prompt response!

    Friday, February 1, 2013 12:23 AM