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
Solved

Passing a parameter to the next page. Phone 8 app

Posted on 2014-02-06
3
264 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
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Jeroen Timmermans earned 400 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

829 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