Vincent
Vincent

Reputation: 3314

How to set a different size windows in UWP Multiple Views?

I have tried the code in How get different size windows in UWP Multiple Views?, but I found a problem.

The new windows size must depend on the current windows size, which means if I use

newAppView.TryResizeView(new Size { Width = 300, Height = 200 });

does not work.

But use

newAppView.TryResizeView(new Size { Width = rect.Width - 300, Height = rect.Height - 200 });

works.

Then how to set a new window size, ignoring current window size.

Upvotes: 1

Views: 42

Answers (1)

Anran Zhang
Anran Zhang

Reputation: 7737

It is not that setting the window size is invalid, but that the values you set for Width and Height are not in the valid range.

Default:

  • Min Width: 500
  • Min Height: 320

As long as either Width or Height is below the minimum value, the window cannot be resized.

Upvotes: 1

Related Questions