private async void CheckUpates() { StoreHelper store = new StoreHelper(_mainHandler); var icon = IoC.Get <TaskbarIcon>(); await store.DownloadAndInstallAllUpdatesAsync(() => { var result = MessageBox.Show("是否更新。", "检测到新版本", MessageBoxButton.OKCancel); return(result == MessageBoxResult.OK); }, (progress) => { if ((int)progress.PackageUpdateState >= 3) { icon.ShowBalloonTip("温馨提示", $"《眼睛护士》如果更新失败,请关闭软件打开应用商店手动更新。", BalloonIcon.Info); } }); }