I have a UWP app which, when launched, I want to assign a fixed width, horizontally center, and vertically stretch to the size of the screen (excluding the Task Bar). I would also like to keep it this size & position, although I realize that this may not be allowed. I have tried the following in App.xaml.vb immediately after Window.Current.Activate() in the OnLaunched method:
ApplicationView.GetForCurrentView().TryResizeView(New Size(560, ApplicationView.GetForCurrentView().VisibleBounds.Height))
This works fine for the width, but the height (which is returning 900 on my machine) is not the full height (even without the Task Bar). If I add a value to this height, it increases the height, but the maximum that it allows me to add is 20, which still does not fill the full height.
Here is the basic list of things I need to do (that I have not figured out):
- Stretch the app to the full height of the screen (without the Task Bar)
- Horizontally center the app
- Prevent the app from being resized (if possible, otherwise, I would like to come up with an easy way for the user to automatically resize & center it, such as a Button)
Is there any way to do these things? Thanks.