Passing Page Arguments Using Query Strings

Query strings allow for key value pairs to be embedded in a URL and passed to a page. Just like HTML web applications, Windows Phone apps use query string parameters for inter-page communication.

The PhoneApplicationPage.NavigationContext property, which is initialized after the page is created, is used to retrieve the query string. Its QueryString property is an IDictionary of string key and value pairs. The following excerpt from the WebBrowserView.xaml.cs, in the downloadable sample code, demonstrates how to retrieve a query string value:

protected overide void OnNavigatedTo(NavigationEventArgs e){    base.OnNavigatedTo(e);    string url;    if (NavigationContext.QueryString.TryGetValue( ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.