UWP How to save application last screen location

MangoApps 91 Reputation points
2020-05-06T13:37:05.153+00:00

I want to open my UWP app on the same location where I close the application last time
it is possible in UWP?

I check when I open the windows store and then I move windows store location and then close and re-open ... it's open at the same location where I close it last time...

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Fay Wang - MSFT 5,206 Reputation points
    2020-05-07T02:56:08.453+00:00

    Hello,

    Welcome to Microsoft Q&A!

    not working for me after App.Current.Exit(); application it open always in left side only.

    This method will terminate the app instead of suspending it. When you use the App.Current.Exit(); method to close the app and run it again, the PreviousExecutionState in the OnLaunched event will show NotRunning state. Based on the document of lifecircle, it mentions:

    When the ApplicationExecutionState is NotRunning, it will initialize the app as if it is running for the first time in the current user session.

    So it is an expected behavior, it will always be opened in the left side.

    I want to open my UWP app on the same location where I close the application last time it is possible in UWP

    Currently, there is no api can change the position of app in UWP. In addition, from the remark of Application.Exit, it is not recommended to exit the app programmatically since the system automatically manages app lifetime and terminates suspended apps as needed to free resources.

    0 comments No comments

0 additional answers

Sort by: Most helpful