2014-03-13 93 views
0

是否有可能,如果是的话,你如何从另一个Windows 8.1应用程序启动已安装在计算机上的Windows 8.1应用程序?我可以启动另一个win8应用程序吗?

我发现,Windows Phone的8,你可以使用以下命令:

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

,但我无法找到一个Windows 8的等价物。

我已阅读约Uri activationUri schemes,但无法找到我的问题的答案。

在此先感谢您的帮助。

回答

0

下面是一个打开PDF文件的示例,让用户选择他们想要使用的应用程序。如果应用程序未安装,则会提示用户从商店下载。

另请注意,我将应用程序设置为对齐并在另一个应用程序中并排打开文件。

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 
      }); 
} 

enter image description here

enter image description here

enter image description here

+0

如果他们首选的应用程序安装,然后设置显示应用程序管理器为false,将首选的应用程序会自动打开?也只有通过打开文件才有可能? - 也感谢迄今为止的帮助 –

相关问题