在Navigated上的页面之间导航时传递数据时,找不到在Windows Phone 7中覆盖的合适方法 [英] passing data while navigation between pages onNavigatedTo no suitable method found to override in Windows Phone 7
本文介绍了在Navigated上的页面之间导航时传递数据时,找不到在Windows Phone 7中覆盖的合适方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在页面之间导航时,我尝试传递参数. 在第一页中,我有:
I'm try to pass a parameter while navigate between pages.. in the firs page I have:
private void companyGrid_Tap(object sender, GestureEventArgs e)
{
String tempVal = "";
tempVal = "PassVal";
NavigationService.Navigate(new Uri("/ComPage.xaml?comID=" + tempVal, UriKind.Relative));
}
在下一页中,我有:
protected override void onNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
String strId = NavigationContext.QueryString["comID"];
}
但是我收到关于覆盖"onNavigatedTo"数学方法的错误,说:找不到适合的方法来覆盖"
but I get an error about the override "onNavigatedTo" mathod say: "no suitable method found to override"
我检查了一下,所有示例都以相同的方式传递参数... 也许有人知道它不起作用的原因是什么?
i check and all the Examples show the same way to pass the parameter... Maybe someone know what the reason it's not working???
推荐答案
此刻我不在桌面上,所以不能100%确定,但是不应该是OnNavigatedTo(开头是大写O)吗?
I'm not at my desktop at the moment so not 100% sure, but shouldn't it be OnNavigatedTo (capital O at the start)?
因此,您将拥有:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
String strId = NavigationContext.QueryString["comID"];
}
这篇关于在Navigated上的页面之间导航时传递数据时,找不到在Windows Phone 7中覆盖的合适方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文