?
Solved

Passing a parameter to the next page. Phone 8 app

Posted on 2014-02-06
3
Medium Priority
?
268 Views
Last Modified: 2014-02-07
I would like to pass a parameter to the page that is being called.    

void ListBox_SelectionChanged(object sender,
                     System.Windows.Input.GestureEventArgs e)
        {
            int Test1 = 0;
            NavigationService.Navigate(new Uri("/OddsChartPage.xaml", UriKind.Relative));

string strMyParameter = "Yes";
?? Pass this parameter to OddsChartPage.xaml
        }

How can I do this?

Thanks,
0
Comment
Question by:Dovberman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Jeroen Timmermans earned 1600 total points
ID: 39841312
void ListBox_SelectionChanged(object sender,
                     System.Windows.Input.GestureEventArgs e)
        {
            int Test1 = 0;

            string strMyParameter = "Yes";

            NavigationService.Navigate(new Uri("/OddsChartPage.xaml?prm=" + strMyParameter, UriKind.Relative));
        }

Open in new window


and on OddsChartPage:

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

            string msg = "";
            
            if (NavigationContext.QueryString.TryGetValue("prm", out msg))

                textBlock1.Text = msg;

           
        }

Open in new window

0
 

Author Comment

by:Dovberman
ID: 39841752
Just what I needed.

Thanks
0
 

Author Closing Comment

by:Dovberman
ID: 39841753
Just what I needed.

Thanks
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question