c# - Win Phone 8 : Navigating Only One Time -
i'm on windows phone 8 project. doing xaml in visual studio.
i have 4 pivot items in project.
i want navigate home page (my first pivot item) with
menu on bottom of phone;
<shell:applicationbariconbutton iconuri="images/appbar_home.png" text="home" click="applicationbariconbutton_click_2"/>
and on click event wrote this;
private void applicationbariconbutton_click_2(object sender, eventargs e) { navigationservice.navigate(new uri("/mainpage.xaml?pivotmain.selectedindex = 0", urikind.relative)); }
when run program, works nice, when go other pivot items, , click home button, goes, if walk around again , click button, doesnt work. why ?
i need solve this.
thanks answers.
you having problem because doing wrong.
navigationservice.navigate
meant navigate between xaml files, not reload them. phone doesn't reload same page on , over.
what want instead set current selected index first page.
it this
private void applicationbariconbutton_click_2(object sender, eventargs e) { pivotcontrolname.selectedindex = 0; }
Comments
Post a Comment