How to launch Metro IE from Metro App
-
Friday, September 16, 2011 3:46 AMI want to have the user click on a hyperlink button and launch the Metro IE to navigate to a url. I'm missing something in the API, because I'm not seeing how to do this. Is this supported? Or is there a more generic approach where you just tell Windows API to open the link and it determine's how the user wants me to open it? Help please.
All Replies
-
Friday, September 16, 2011 4:05 AM
Yes - just indirectly. You need to handle Click and then manually launch the browser using:
Windows.System.Launcher.LaunchDefaultProgram(new Uri(yourLink));
Joe- Proposed As Answer by Tim Heuer [MSFT]Microsoft Employee Friday, September 16, 2011 5:46 AM
- Marked As Answer by Dennis Middleton - MSFTMicrosoft Employee, Moderator Friday, September 16, 2011 6:38 PM
-
Sunday, September 18, 2011 3:21 PMThanks Joe, that worked perfectly.
-
Thursday, October 25, 2012 11:03 PM
In the RTM tools the API has changed, for Windows Store metro apps the following code is necessary:
using Windows.System; ... /// <summary> /// Displays the privacy policy in the browser. /// </summary> public async void ShowPrivacyPolicy() { await Launcher.LaunchUriAsync(new Uri("http://www.mywebserver.com/MyPrivacyPolicyPath")); }Also weird was that unless I added "Windows.System" with a using statement it did not resolve the Launcher class. This was on a clean Win8 Pro OS and VS2012 build I just installed.
Key Artefacts
- Proposed As Answer by Alessio Mannelli Sunday, October 28, 2012 8:18 PM


