Solved

Passing a parameter to the next page. Phone 8 app

Posted on 2014-02-06
3
262 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Runtime Error 2 28
Angular JS Route 3 47
Replace &lt; with < 14 55
When should I use a controller? 3 10
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now