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")
精彩评论