c# - how to show a message box with ok and cancel button -
i building app windows phone 7 need show message box both ok , cancel button. when ok button pressed want navigate new page while when cancel button pressed want stay in same page:
the code wrote is:
public donate() { initializecomponent(); messageboxresult result = messagebox.show("this take out of app , forward our contribution website!", "", messageboxbutton.okcancel); if (result == messageboxresult.ok) { donation.source = new uri("http://mobiledonation.vzons.com/arvindkejriwal", urikind.absolute); donation.loaded += (object sender, routedeventargs e) => { donation.navigate(new uri("http://mobiledonation.vzons.com/arvindkejriwal", urikind.absolute)); }; } else navigationservice.navigate(new uri("/aap.xaml", urikind.relative)); }
now here problem when cancel button pressed null reference exception in statement
navigationservice.navigate(new uri("/aap.xaml", urikind.relative));
ok button working fine when cancel button pressed want stay in same page i.e aap.xaml. how can achieve this?
Comments
Post a Comment