
This example creates the simple picture/info app UI shown previously in the Examples section. See Responsive layouts with XAML and Layout panels for more info about creating an adaptive UI. The panes can change size and switch between wide and tall modes, so you need to make sure the content in each pane can adapt to these changes. To add content, you typically place a XAML layout panel in each pane, and then add other controls and content to the panel.

(If you do, only the outer TwoPaneView is spanning-aware.) Add content to the panesĮach pane of a two-pane view can hold a single XAML UIElement. The TwoPaneView adapts appropriately regardless of where it is in the XAML tree however, we do recommend that you not nest a TwoPaneView inside another TwoPaneView. In fact, you'll often use it inside a NavigationView control that provides the overall navigation for your app. The TwoPaneView doesn't have to be the root element of your page layout. The two-pane view takes care of the rest. You only need to set the tall/wide configuration to specify which pane is shown on which screen. Spanning-awareness is built-in when you use two-pane view. When your app spans both screens of a dual-screen device, each screen displays the content of one of the panes and properly spans content across the gap. The window sizes itself to use all the available space on the screens. The TwoPaneView is designed to make it easy to optimize your UI for spanning on dual-screen devices. The only difference between devices is that some devices, like desktop PCs, allow re-sizable windows, while other devices don't. We explain these properties in more detail in the next section. When your app is on only a single screen, the TwoPaneView adjusts the size and position of its panes based on property settings you specify. The TwoPaneView manages the display of the panes based on the spanning state of the app. The two-pane view handles the size and arrangement of the panes, but you still need to make the content inside the pane adapt to the changes in size and orientation.

Then, you specify whether Pane1 is shown on the top or bottom for tall windows, or on the left or right for wide windows. You configure the two-pane view by setting the PanePriority to specify which pane is shown when there is space for only one pane. Panes are shown top-bottom, or a single pane is shown, as specified by the TallModeConfiguration property. Panes are shown side-by-side, or a single pane is shown, as specified by the WideModeConfiguration property. Only one pane is shown, as specified by the PanePriority property. The possible pane layouts are defined by the TwoPaneViewMode enumeration: Enum value It adjusts the size and arrangement of the panes depending on the space available to the window. The two-pane view has two panes where you place your content. The two-pane view adapts the app UI to the various screen configurations.Īpp spanning a dual-screen device in wide mode.Īpp spanning a dual-screen device in tall mode. These images show an app running on a single-screen and spanned across dual-screens.


We have added this using statement at the top of the file: using muxc = Microsoft.UI.Xaml.Controls Is this the right control?
Adjustable window screens display windows#
In the code-behind, we also use the muxc alias in C# to represent the Windows UI Library APIs that we have included in our project. We have added this to our Page element: xmlns:muxc="using:Microsoft.UI.Xaml.Controls" Throughout this document, we use the muxc alias in XAML to represent the Windows UI Library APIs that we have included in our project.
