开发者

Key not found exception pivot wp7

On my detail.xaml

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    base.OnNavigatedTo(e);

    this.PageTitle.Text = NavigationContext.QueryString["lineone"];
    this.Contents.Text = NavigationCo开发者_StackOverflowntext.QueryString["linethree"];
    //populate book text control here
}

but when i enter lineone in place of line three it works fine except it shows the data of line one in the contents section.

I am using default pivot based layout for windows phone 7


If you attempt to access a key that isn't found, you get a exception.

So instead of NavigationContext.QueryString["key"] you should use NavigationContext.QueryString.TryGetValue("key")

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜