passing data while navigation between pages onNavigatedTo no suitable method found to override in Windows Phone 7 [closed]

此生再无相见时 提交于 2019-12-10 22:04:22

问题


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));
    }

and in the next page i have:

protected override void onNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);
        String strId = NavigationContext.QueryString["comID"];

    }

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???


回答1:


I'm not at my desktop at the moment so not 100% sure, but shouldn't it be OnNavigatedTo (capital O at the start)?

So you'd have:

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    base.OnNavigatedTo(e);
    String strId = NavigationContext.QueryString["comID"];
}


来源:https://stackoverflow.com/questions/11014715/passing-data-while-navigation-between-pages-onnavigatedto-no-suitable-method-fou

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!