zoukankan      html  css  js  c++  java
  • windows 10 自适应布局

    https://msdn.microsoft.com/library/windows/apps/dn894631.aspx

    Use visual state triggers to build UI that can adapt to available 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 is activated, which then sets layout properties as appropriate for the window size that triggered the state change.

    In the following example, when the window size is 720 pixels or more in width the best-rated games are displayed to the right of the top free games panel and aligned with the top of the top free games panel. The visual state named wideView is triggered when the window is 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 Top free games panel.

    Visual state trigger example. Wide view

    When the window is less than 720 pixels, the narrowView visual state is triggered because the wideViewtrigger 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, the Top paid games panel:

    Visual state trigger example. Narrow view

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

     
    <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>
                </VisualState>
                <VisualState x:Name="narrowView">
                    <VisualState.Setters>
                        <Setter Target="best.(RelativePanel.Below)" Value="paid"/>
                        <Setter Target="best.(RelativePanel.AlignLeftWithPanel)" Value="true"/>
                    </VisualState.Setters>
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        ...
    </Grid>
    
  • 相关阅读:
    转:ITIL的開源軟件
    转:Asp.Net大型项目实践
    转:Ubuntu上apache多端口配置虚拟主机的方法
    转:JS 获取鼠标位置
    转:一切整合分享到新浪网易微博代码
    转:Facebook是如何发布代码的
    转:利用 Amazon Web Services 集成企业应用程序使用 Amazon SQS 发送 XML 消息
    sqlite3 常用操作
    转:4 款消息队列软件产品大比拼
    SQL Server 2008 列转行 实例
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/4565531.html
Copyright © 2011-2022 走看看