windows phone 7 - Control press "back button" and disable close the application using a dialog for confirm - wp7 -


i need show simple dialog question : 'do want exit application?' yes or no. dialog shown when user presses button of device.

i know how can show dialog , don't know how disable action: close app.

it's closed.

if understand correctly, want display confirmation dialog when user clicks button on main page of app ask whether want exit. if user selects yes app exits, otherwise cancel navigation. this, in mainpage class constructor hook event handler

mainpage() {   backkeypress += onbackkeypressed; }  void onbackkeypressed( object sender, canceleventargs e ) {   var result = messagebox.show( "do want exit?", "attention!",                                  messageboxbutton.okcancel );    if( result == messageboxresult.ok ) {     // not cancel navigation     return;   }   e.cancel = true; } 

Comments

Popular posts from this blog

Python __call__ special method practical example -

arrays - jQuery - Retrieve values from HTML elements and return their sum -