根据 Microsoft 文档,它为两个窗格视图声明了以下内容:
By default, Pane1Length is set to Auto and it sizes itself to fit its content. Pane2Length is set to * and it uses all the remaining space.
使用以下代码,我看不到应用了默认行为。我是否缺少一些需要明确设置的额外属性?我的最终目标只是让 Pane1 始终显示在单屏设备上,并隐藏 Pane2。
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<muxc:TwoPaneView x:Name="MyTwoPaneView">
<muxc:TwoPaneView.Pane1>
<Grid x:Name="Pane1Root"
Background="Orange">
</Grid>
</muxc:TwoPaneView.Pane1>
<muxc:TwoPaneView.Pane2>
<Grid x:Name="Pane2Root"
Background="Green">
</Grid>
</muxc:TwoPaneView.Pane2>
</muxc:TwoPaneView>
</Grid>