Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

First time after the app launch, it is opening in a default size other than the size set. #53

Open
rahulkps23 opened this issue Apr 27, 2020 · 0 comments

Comments

@rahulkps23
Copy link

When you run the UWP app on a PC for the first time, the app will open in size(other than the height and width we set) other than the size we set. From second time when we open the app in that PC there is no issue, it will open in the size which we set. Issue is present only during first time open of the app on that particular PC.

  • To reproduce this issue on the same PC we need to unistall and install the app and open the app. So that it behaves as if it is installed freshly on this PC and it opens in a size it wish(may be some default size values it taking when opened for first time).

  • Our team tried to fix this by searching the place to put the default height and width values, but we didn't find any way. Is there any other way or is this a bug?

  • The temporary solution we made is we are resizing the screen to the required size(height and width) values if the app is open for the first time on that PC.
    eg: we need to write this code in onnavigated to and onlaunched methods of app,xaml.cs:

`Size size = new Size(width, height);

ApplicationView.GetForCurrentView().SetPreferredMinSize(size);
ApplicationView.PreferredLaunchViewSize = size;
ApplicationView.PreferredLaunchWindowingMode=ApplicationViewWindowingMode.PreferredLaunchViewSize;`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant