简体   繁体   中英

Navigated event for WebBrowserTask in WP7?

Is there a way to handle a similar event to the phone:WebBrowser's Navigated event on WP7.1, but for a WebBrowserTask? I want to open a new WebBrowserTask this way:

WebBrowserTask task = new WebBrowserTask();
task.Uri = new Uri(url);
task.Show();

Then, when the user navigates to a new URL from that WebBrowserTask, I would like to be able to retrieve the new URL she has navigated to from the same class the WebBrowserTask was created. Can I do this without having a WebBrowser element in my View, or having it and linking it somehow to this WebBrowerTask?

Thanks in advance!

The WebBrowserTask launches the native web browser. As a result your application is suspended, there are no 'hooks' available from the native browser that will allow you to detect changes in URL and re-activate your application.

To achieve the effect you are after you need to use the WebBrowser control so that your application is not suspended. WebBrowser does have navigation events that will support your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM