当我导航到具有Panorama控件的视图时,我想设置Panorama控件的Title,Title值将使用上一个视图中的查询字符串进入。我怎么做?
答案 0 :(得分:2)
如果您从其他页面导航:
page.xaml,CS:
private void Navigate()
{
string name = "Test";
// Navigate to Panorama page
NavigationService.Navigate(new Uri("/Pages/PanoramaPage.xaml?name=" + name, UriKind.Relative));
}
PanoramaPage.xaml.cs:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
string name = "";
if (NavigationContext.QueryString.TryGetValue("name", out name))
{
PageTitle.Text = name;
}
}