windows phone 7 - Pause WP7 HyperlinkButton? -


i'm trying 'pause' hyperlinkbutton in wp7 app user can confirm whether or not leave app , follow link. series of events like:

  1. the user clicks hyperlinkbutton
  2. messagebox pops confirm want leave app , visit external site
  3. if user agrees, webpage loads; if not, user returned app

my question is: can get hyperlinkbutton to wait user's response?

at moment, i've hacked solution below:

<hyperlinkbutton tag="http://www.google.com/" tap="confirmbeforeloading()"/> 

confirmbeforeloading prompts user and, if agree, creates new webbrowsertask using address in tag property.

this works, seems 'hackish'. there way can use normal hyperlinkbutton navigateuri , have wait user's response?

many in advance!

try one,maybe helpfull you,

    popup mypopup;   //golbal variable      private void hyperlinkbutton1_click(object sender, routedeventargs e)      {         layoutroot.opacity = 0.6;         mypopup = new popup();         border border = new border();         stackpanel st = new stackpanel();          textblock tb = new textblock();         tb.text = "visit website";         tb.fontsize = 24;          button btnok = new button();         btnok.content = "ok";         btnok.click += new routedeventhandler(btnok_click);         button btncancel = new button();         btncancel.content = "cancel";         btncancel.click += new routedeventhandler(btncancel_click);          st1.orientation = system.windows.controls.orientation.horizontal;         st1.children.add(btnok);         st1.children.add(btncancel);          st.children.add(tb);         st.children.add(st1);           border.child = st;         mypopup.verticaloffset = 25;         mypopup.horizontaloffset = 25;         mypopup.margin = new thickness(layoutroot.actualwidth / 4, layoutroot.actualheight / 3, 0, 0);         mypopup.child = border;         mypopup.isopen = true;     }       void btncancel_click(object sender, routedeventargs e)      {         layoutroot.opacity = 1;         mypopup.isopen = false;     }      void btnok_click(object sender, routedeventargs e)      {         //here want....     } 

its work me.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -