locked
How to Close app metro in WinRT 8.1

    Question

  • Hi Everybody,

    I want to implement button [Close App] in UI , not using icon [X] in WinRT 8.1

    I try to using  Application.Current.Exit(); Window.Current.Close(); but not sucess.

    Please support me. Thanks so much.

               
               

    Thursday, April 9, 2015 12:40 AM

Answers

  • Why do you want to do this? What is the scenario you are trying to achieve? What is the overall goal?

    Adding a close app button to the app's UI is strongly recommended against.

    There are very few scenarios where this is a useful thing to do. Unless this is in response to an unrecoverable error state there is probably a better way to achieve the overall goal than a close button.

    Letting the system and the User control the app's lifetime is cleaner, standard, and less power-hungry than forcing a closure.

    That said, Application.Current.Exit() is the way to exit an app programmatically. If you really want to go down this path, in what way is it not working for you?

    Thursday, April 9, 2015 12:54 AM
    Owner

All replies

  • Why do you want to do this? What is the scenario you are trying to achieve? What is the overall goal?

    Adding a close app button to the app's UI is strongly recommended against.

    There are very few scenarios where this is a useful thing to do. Unless this is in response to an unrecoverable error state there is probably a better way to achieve the overall goal than a close button.

    Letting the system and the User control the app's lifetime is cleaner, standard, and less power-hungry than forcing a closure.

    That said, Application.Current.Exit() is the way to exit an app programmatically. If you really want to go down this path, in what way is it not working for you?

    Thursday, April 9, 2015 12:54 AM
    Owner
  • Thanks so much Rob
    Monday, April 13, 2015 9:40 PM