c# - windows phone 8 navigation: Device Physical Button Issue -


when navigation between pages, pressed either start or search button bring me out app. when come app. says navigation service null or similar it.

how solve it!?

dispatcher.begininvoke(delegate()                 {                     textblock b = (textblock)sender;                      var cusid = (textblock)b.findname("cusid");                     var schtime1 = (textblock)b.findname("pschtime");                     int intcusid = convert.toint32(cusid.text);                     string scheduletime = schtime1.text;                      loginvm.getcustomerdetail(intcusid);                      if (loginvm.obcustomerdetail.count != 0)                     {                         foreach (var c in loginvm.obcustomerdetail)                         {                             common.customernetworkid = c.customernetworkid;                             common.intcustomerid = c.id;                             common.customername = c.name;                             common.routeid = c.routeid.value;                             common.strreportedtime = datetime.now.timeofday.hours + ":" + datetime.now.timeofday.minutes;                          }                         getvisitdetailno();                          if (vn == false)                         {                             mypopup.isopen = false;                             backstatus = false;                             return;                         }                         if (common.visitdetailno == null)                         {                             return;                         }                          if (loginvm.savevisitedcustomer(common.visitdetailno, common.strvisitheaderno, common.routeid, common.intcustomerid, common.spoaccid, common.intsalesrepid, common.intareasalesmanageraccid, common.intareasalesmanagerid, common.strtransactiondate, scheduletime, common.strreportedtime) == true)                         {                             //update next visit detail no                             if (updatevisitconfigtable() == true)                             {                                 mypopup.isopen = false;                                 backstatus = false;                                 common.urlstring = "/view/frmcustomermenu.xaml";                                 navigationservice.navigate(new uri("/view/loadingview.xaml", urikind.relative));                                  configvm = new configviewmodel();                                  //bind visited outlets                                 bindvisited();                             }                             else                         }                     }                   }); 

the above direct loading.aspx , code below

gc.collect();             gc.waitforpendingfinalizers();             gc.collect();              dispatcher.begininvoke(delegate() {                 navigationservice.navigate(new uri(common.urlstring, urikind.relative));             }); 

error comes loading.aspx though navigate away page before that.

![enter image description here][1]

highlighted in yellow- navigationservice.navigate(new uri(common.urlstring, urikind.relative));

common.urlstring = "/view/frmfirsttimesync.xaml"

navigationservice = null according error

http://www.tiikoni.com/tis/view/?id=95ecd7b

i cannot post pictures because not have enough reputation

the above question runs formload method. changed navigation service location.

now navigation service works in onnavigatedto method. works fine


Comments