【发布时间】:2015-11-05 12:33:00
【问题描述】:
您好,我正在使用 windows phone 8.1[RT] 应用程序,我只是浏览页面。但我发现我们可以在 xaml 中使用 Frame 的新选项也像这样
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="120"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Background="White">
</Border>
<Button Content="next" Click="Button_Click" Background="Black" />
<Grid Grid.Row="1">
<Frame x:Name="Page1Frame" Background="Black" >
<StackPanel>
<Rectangle Height="100" Width="100" Fill="Red" Margin="5" />
<Rectangle Height="100" Width="100" Fill="Red" Margin="5" />
<Rectangle Height="100" Width="100" Fill="Red" Margin="5" />
<Rectangle Height="100" Width="100" Fill="Red" Margin="5" />
</StackPanel>
</Frame>
</Grid>
</Grid>
并像这样导航这个框架
private void Button_Click(object sender, RoutedEventArgs e)
{
Page1Frame.Navigate(typeof(BlankPage1));
}
在这个例子中,我的 120 高度网格保持不变,只是导航框架。 我只想知道使用哪种最佳做法? 谢谢你。
【问题讨论】:
标签: c# xaml navigation windows-phone-8.1 frame