Wednesday, April 25, 2012

Pass data between pages in Windows Phone

Here's some very useful code to pass data to the second page. I'll add something more about how to get data or selection back.

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    if (this.NavigationContext.QueryString.ContainsKey("text"))
    {
        this.textBlox2.Text = this.NavigationContext.QueryString["text"];
    }

    base.OnNavigatedTo(e);
}

No comments:

Post a Comment