コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: mweilb/SampleCode
        protected override async void OnActivated(EventArgs e)
        {
            if (bLoading == false)
            {
                
                //Test whether the app we want to launch is installed
                var supportStatus = await Launcher.QueryUriSupportAsync(uri, LaunchQuerySupportType.Uri, TargetPackageFamilyName);
                if (supportStatus != LaunchQuerySupportStatus.Available)
                {
                    bLoading = true;
                    Status.Text = "We need to install :) " + supportStatus.ToString();

                    AppInstallManager manager = new AppInstallManager();
                    var installItems = await manager.StartAppInstallAsync("9NBLGGH2JHXJ", "0010", true, false);


                    installItems.StatusChanged += new TypedEventHandler<AppInstallItem, System.Object>((app, obj) => StatusChangedUpdate(Status, app, obj));
                    installItems.Completed += new TypedEventHandler<AppInstallItem, System.Object>((app, obj) => CompletedUpdate(Status, app, obj));
                }
                else {
                    LaunchTargetApp.IsEnabled = true;
                }
            }
        }
コード例 #2
0
 public AppInstallManagerEvents(AppInstallManager This)
 {
     this.This = This;
 }