Navigation from page1.xaml to page2.xaml in windows phone 8 -


i have 2 pages: page1.xaml , page2.xaml. have created 1 button on page1.xaml; on click event navigate page2.xaml. when run application, fails , debugger drops me in app.xaml.cs. below code:

private void rootframe_navigationfailed(object sender, navigationfailedeventargs e)                 {     if (debugger.isattached)     {           // navigation has failed; break debugger                               debugger.break();                  }          }   

my page1.xaml.cs code behind is:

public partial class mainpage : phoneapplicationpage      {     // constructor     public mainpage()        {          initializecomponent();           // sample code localize applicationbar                                 //buildlocalizedapplicationbar();     }      private void btndownloded_click(object sender, routedeventargs e)              {                      navigationservice.navigate(new uri("/downloadedbooksportrait.xaml", urikind.relative));         }  } 

sourcepage.xaml

bookname.id fetching id , of book , through bookid id on our destination page , show data.

navigationservice.navigate(new uri("/mainpage.xaml?selecteditem=" +bookname.id, urikind.relative)); 

destinationpage.xaml

on destination page we fetch query parameter below.

   private void phoneapplicationpage_loaded(object sender, routedeventargs e)    {         string dir = "hello" + selecteditem;    } 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -