【发布时间】:2019-05-14 08:56:30
【问题描述】:
这是我第一次创建Win10 UWP程序。我有一个带有导航视图和框架的页面。 NavigationView 是一个供选择的列表程序。当用户单击其中一个选项时,相应的页面将加载到框架区域中。我尝试下面显示的代码,但是当我单击该项目并加载相应的页面时,该页面将填满整个窗口,而不是仅显示在框架区域中。它导致用户无法从 NavigationView 中选择其他选项。我该如何解决这个问题?
非常感谢!
<Page ...>
<Grid>
<NavigationView PaneDisplayMode="Left">
<NavigationViewItem Content="Item 1" Name="NavigationItem1" />
... // More items here
</NavigationView>
<ScrollViewer>
<Frame Name="ContentFrame"></Frame>
</ScrollViewer>
</Grid>
</Page>
在 C# 中
private NavigationItem1_Tapped(object sender, TappedRoutedEventargs e)
{
ContentFrame.Navigate(typeof(Page_1));
// Page_1 is a Page Object created in the project
}
【问题讨论】: