0

i am facing a problem; during navigating the two pages my application is crashing.

is it possible following scenario in windows phone 8 ?

//In Myonepage.xaml on button click
MySecondpage mypageobject = new MySecondpage();

NavigationService.Source(mypageobject); 
// i know above syntax is not possible but i want something like this. actually i don't want to create new Uri object for navigate to the secondpage.xaml.

If anyone know this scenario to execute than please let me know.

Ashish-BeJovial
  • 1,829
  • 3
  • 38
  • 62
  • NavigationService.Navigat(new Uri(@"/SecondPage.xaml",UriKind.RelativeOrAbsolute)); This is how its done – DotNetRussell Jun 09 '14 at 12:55
  • Anthony Russell, you are right it is the proper way to do it, but do you know 'new Uri' is creating the new object of the page ? and this is generating problem for me, i don't want to call my second page by creating new Uri object, its occupy the memory again and again. i am facing problem because i am doing some memory operations on secondpage so as i redirect with 'new Uri' it will create new object of the page and i face problem when navigate from onepage.xaml to secondpage.xaml. – Ashish-BeJovial Jun 10 '14 at 05:04
  • When your app loads, it loads the mainpage, but not the other pages. So, when you call your second page, I guess you need to load it, and therefore, call the object that generates it. I might be wrong, but I think it's something like that – DevBob Jun 10 '14 at 06:54
  • @AshishJain Any residual changes on a page should cache to the isolated storage. Then on NavigatedFrom you dispose of the page. Usually this is handled for you so you must be doing some really weird operations. I would evaluate your architecture if you are having questions like this. You're likely doing something wrong. – DotNetRussell Jun 10 '14 at 12:13

0 Answers0