让我们说我有一个网格,每个单元格内有2行,2列和许多控件.
当应用程序更改为捕捉模式时,我的意思是屏幕的1/3,我希望应用程序只有一个列,2行,并且只显示我将决定的一些控件.
我对此有什么样的控制?
谢谢
您应该在xaml中使用visualstatemanager,以获得完整的xaml解决方案:
<Grid x:Name="LayoutRoot">
<visualstatemanager.VisualStateGroups>
<VisualStateGroup x:Name="OrientationStates">
<VisualState x:Name="Full"/>
<VisualState x:Name="Fill"/>
<VisualState x:Name="Portrait"/>
<VisualState x:Name="Snapped"/>
</VisualStateGroup>
</visualstatemanager.VisualStateGroups>
</Grid>
为每个VisualState创建StoryBoards并隐藏/显示xaml中的元素. Microsoft示例使用相同的解决方案.
–
更新
我在网上搜索并找到了正确的状态,这个链接背后有一个例子:MSDN.
<visualstatemanager.VisualStateGroups>
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="FullScreenLandscape"/>
<VisualState x:Name="Filled"/>
<VisualState x:Name="FullScreenPortrait"/>
<VisualState x:Name="Snapped"/>
</VisualStateGroup>
</visualstatemanager.VisualStateGroups>
各州反映ApplicationViewState枚举.更多信息可以在here找到.