Discovering Your Window Size and Location

You might want to make several adjustments to your user interface depending on the exact dimensions given to your app or simply whether your app is currently taller than it is wide (caused by the portrait orientation or by sharing the screen with other windows on a PC). Perhaps you need to scale elements, add/remove them, or rearrange them. Apps with multi-column user interfaces often reduce then eliminate columns as their window size shrinks. Apps often switch between horizontal scrolling and vertical scrolling of the same content depending on whether their window is portrait-shaped or landscape-shaped.

You can discover the size of your window at any time with the Window.Current.Bounds property of type ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.