Windows 10 Adaptive Layouts

Source: Internet
Author: User

Https://msdn.microsoft.com/library/windows/apps/dn894631.aspxUse visual state triggers to build UI This can adapt to Avai lable screen Space

Your UI may need to adapt to changes in window size. Adaptive visual states allows you to change the visual state in response to changes in the size of the window.

Statetriggers define a threshold at which a visual state was activated, which then sets layout properties as appropriate fo R the window size that triggered.

In the following example, when the window was 720 pixels or more on width The best-rated games was displayed to the RI Ght of the top Free games panel and aligned with the top of the "Top free" games panel. The visual state named Wideview was triggered when the window was a minimum of 720 pixels wide, which then arranges The best-rated Games panel to appear to the right of, and aligned with the top of the, the top free games p Anel.

When the window was less than 720 pixels, the narrowview visual state was triggered because the wideviewtr Igger is no longer satisfied and so no longer in effect. The Narrowview visual State positions the best-rated Games panel below, and aligned with the left of, th E Top paid games Panel:

Here's the XAML for the visual state triggers described above. The definition of the panels, alluded to by " ... " below, have been removed for brevity.

Xaml
<grid background= "{ThemeResource Applicationpagebackgroundthemebrush}" > <                visualstatemanager.visualstategroups> <VisualStateGroup> <visualstate x:name= "Wideview" >                <VisualState.StateTriggers> <adaptivetrigger minwindowwidth= "720"/> </VisualState.StateTriggers> <VisualState.Setters> <setter Target = "best." (relativepanel.rightof) "value=" free "/> <setter target=" best. (relativepanel.aligntopwidth) "value=" free "/> </VisualState.Setters> &LT;/VISUALSTATE&G            T <visualstate x:name= "Narrowview" > <VisualState.Setters> <setter target= "b Est. (relativepanel.below) "value=" paid "/> <setter target=" best.             (Relativepanel.alignleftwithpanel) "value=" true "/> </VisualState.Setters>   <VisualState.StateTriggers> <adaptivetrigger minwindowwidth= "0"/> </v isualstate.statetriggers> </VisualState> </VisualStateGroup> &LT;/VISUALSTATEMANAGER.V Isualstategroups> ...</grid>

Windows 10 Adaptive Layouts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.