Solved

Passing a parameter to the next page. Phone 8 app

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

21 Experts available now in Live!

Get 1:1 Help Now