How to change window size UWP in Hololwns?
up vote
1
down vote
favorite
I want to set a window size for my app once. Since it is bigger than the default window, I could do it either by setting a minimum size, or by changing the size myself to that minimum during the launch.
I have tried
ApplicationView.PreferredLaunchViewSize = new Size(1200, 900);
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(800, 600));
and this
float DPI = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
Windows.UI.ViewManagement.ApplicationView.PreferredLaunchWindowingMode = Windows.UI.ViewManagement.ApplicationViewWindowingMode.PreferredLaunchViewSize;
var desiredSize = new Windows.Foundation.Size(((float)800 * 96.0f / DPI), ((float)600 * 96.0f / DPI));
Windows.UI.ViewManagement.ApplicationView.PreferredLaunchViewSize = desiredSize;
Window.Current.Activate();
bool result = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryResizeView(desiredSize);
But none work. What am I missing?
uwp resize window
add a comment |
up vote
1
down vote
favorite
I want to set a window size for my app once. Since it is bigger than the default window, I could do it either by setting a minimum size, or by changing the size myself to that minimum during the launch.
I have tried
ApplicationView.PreferredLaunchViewSize = new Size(1200, 900);
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(800, 600));
and this
float DPI = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
Windows.UI.ViewManagement.ApplicationView.PreferredLaunchWindowingMode = Windows.UI.ViewManagement.ApplicationViewWindowingMode.PreferredLaunchViewSize;
var desiredSize = new Windows.Foundation.Size(((float)800 * 96.0f / DPI), ((float)600 * 96.0f / DPI));
Windows.UI.ViewManagement.ApplicationView.PreferredLaunchViewSize = desiredSize;
Window.Current.Activate();
bool result = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryResizeView(desiredSize);
But none work. What am I missing?
uwp resize window
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to set a window size for my app once. Since it is bigger than the default window, I could do it either by setting a minimum size, or by changing the size myself to that minimum during the launch.
I have tried
ApplicationView.PreferredLaunchViewSize = new Size(1200, 900);
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(800, 600));
and this
float DPI = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
Windows.UI.ViewManagement.ApplicationView.PreferredLaunchWindowingMode = Windows.UI.ViewManagement.ApplicationViewWindowingMode.PreferredLaunchViewSize;
var desiredSize = new Windows.Foundation.Size(((float)800 * 96.0f / DPI), ((float)600 * 96.0f / DPI));
Windows.UI.ViewManagement.ApplicationView.PreferredLaunchViewSize = desiredSize;
Window.Current.Activate();
bool result = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryResizeView(desiredSize);
But none work. What am I missing?
uwp resize window
I want to set a window size for my app once. Since it is bigger than the default window, I could do it either by setting a minimum size, or by changing the size myself to that minimum during the launch.
I have tried
ApplicationView.PreferredLaunchViewSize = new Size(1200, 900);
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(800, 600));
and this
float DPI = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
Windows.UI.ViewManagement.ApplicationView.PreferredLaunchWindowingMode = Windows.UI.ViewManagement.ApplicationViewWindowingMode.PreferredLaunchViewSize;
var desiredSize = new Windows.Foundation.Size(((float)800 * 96.0f / DPI), ((float)600 * 96.0f / DPI));
Windows.UI.ViewManagement.ApplicationView.PreferredLaunchViewSize = desiredSize;
Window.Current.Activate();
bool result = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryResizeView(desiredSize);
But none work. What am I missing?
uwp resize window
uwp resize window
asked Nov 7 at 17:06
Mediarea
1289
1289
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194365%2fhow-to-change-window-size-uwp-in-hololwns%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown