Starts the default app associated with the specified file or URI.
Launch a file contained in the app package
Async voidDefaultlaunch () {//Path to the file in the app launch stringImageFile =@"Images\test.png"; varFile =awaitWindows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync (ImageFile); if(File! =NULL) { //Launch the retrieved file varSuccess =awaitWindows.System.Launcher.LaunchFileAsync (file); if(Success) {//File launched } Else { //File Launch failed } } Else { //Could not find file }}
Launch a URI
//The URI to launchstringUritolaunch =@"http://www.bing.com";//Create A Uri object from a URI stringvarURI =NewUri (uritolaunch);//Launch the URIAsync voidDefaultlaunch () {//Launch the URI varSuccess =awaitWindows.System.Launcher.LaunchUriAsync (URI); if(Success) {//URI launched } Else { //URI Launch failed }}
Windows Phone Launcher Class