在页面之间导航时传递数据onNavigatedTo找不到在Windows Phone 7中覆盖的合适方法

tov*_*ash 3 navigation overriding parameter-passing windows-phone-7

我尝试在页面之间导航时传递参数..在第一页我有:

private void companyGrid_Tap(object sender, GestureEventArgs e)
    {
        String tempVal = "";
        tempVal = "PassVal";
        NavigationService.Navigate(new Uri("/ComPage.xaml?comID=" + tempVal, UriKind.Relative));
    }
Run Code Online (Sandbox Code Playgroud)

在下一页我有:

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

    }
Run Code Online (Sandbox Code Playgroud)

但我得到一个关于覆盖"onNavigatedTo"的错误,例如:"找不到合适的方法来覆盖"

我检查和所有的例子显示相同的方式传递参数...也许有人知道它不工作的原因???

Gra*_*ger 5

我现在不在我的桌面上,所以不是100%肯定,但不应该是OnNavigatedTo(开始时的资本O)?

所以你有:

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