Sweta Sinha

Sweta Sinha

  • NA
  • 51
  • 40.5k

Pass object from one page to another in wp8

Dec 8 2014 2:29 AM

If I have to pass an object from one page to another in wp8.What should be done? As For passing string or int values we use querystring.Can we do the same for passing the object:-

Vehicle vm = item as Vehicle;

NavigationService.Navigate(new Uri("/Page2.xaml?values=" + vm, UriKind.Relative));

and in the other class:-

var values1="";

if (NavigationContext.QueryString.TryGetValue("values", out values1))
{
   //do something with the parameter
}

Answers (1)