示例#1
0
        private async void buttonRemove_Click(object sender, RoutedEventArgs e)
        {
            ContentDialog cd = new ContentDialog
            {
                Title             = "Info",
                Content           = "Are you sure you want to remove all selected apps?",
                PrimaryButtonText = "Yes",
                CloseButtonText   = "No"
            };
            ContentDialogResult result = await cd.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                // Add some blur effect
                System.Windows.Media.Effects.BlurEffect myBlur = new System.Windows.Media.Effects.BlurEffect();
                myBlur.Radius = 5;
                this.Effect   = myBlur;

                await Task.Run(() => { RemoveUWP.RemoveAppx(appxViewModel.apps); });

                LoadApps();

                this.Effect = null;
            }
        }
示例#2
0
        private async void buttonRemove_Click(object sender, RoutedEventArgs e)
        {
            ContentDialog cd = new ContentDialog
            {
                Title             = "Info",
                Content           = "Are you sure you want to remove all selected apps?",
                PrimaryButtonText = "Yes",
                CloseButtonText   = "No"
            };
            ContentDialogResult result = await cd.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                ProgressRing.IsActive = true;
                await Task.Run(() => { RemoveUWP.RemoveAppx(appxViewModel.apps); });

                LoadApps();
                ProgressRing.IsActive = false;
            }
        }