简体   繁体   中英

Can I launch another win8 app?

Is it possible, and if so how can you launch a windows 8.1 application that has been installed on the computer from another windows 8.1 application?

I have found that for windows phone 8 you can use the following:

IEnumerable<Package> apps = Windows.Phone.Management.Deployment.InstallationManager.FindPackagesForCurrentPublisher();
apps.First().Launch(string.Empty);

but I cannot find a windows 8 equivalent.

I have read about Uri activation and Uri schemes but was unable to find the answer to my question.

Thanks in advance for any help.

Here is an example where you open a PDF file, letting the user select the application they want to use. If the application is not installed, it prompts the user to download it from the store.

Notice also that I set the application to snap to the side and open the file in the other app side by side.

private async void TextBlock_Tapped(object sender, TappedRoutedEventArgs e)
{
    StorageFile pdf = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/irisclasson.pdf"));

    await
        Launcher.LaunchFileAsync(pdf,
            new LauncherOptions
            {
                PreferredApplicationDisplayName = "PDF Touch",
                PreferredApplicationPackageFamilyName = "162a2931-8ee6-4a56-9570-53282525d7a3",

                DisplayApplicationPicker = true,
                DesiredRemainingView = ViewSizePreference.UseHalf
            });
}

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

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