Interaction logic for FailuresDialog.xaml
상속: System.Windows.Controls.UserControl
예제 #1
0
        private async void StartCleaning(ProgressBar progressBar, DialogSession session)
        {
            var callback =
                new Progress <int>(
                    i => { progressBar.Dispatcher.BeginInvoke(new Action(() => { progressBar.Value = i; })); });
            var result = await cleanerService.CleanAsync(currentResult, callback);

            if (result.Failures.Count > 0)
            {
                await progressBar.Dispatcher.BeginInvoke(new Action(() =>
                {
                    var failuresDialog = new FailuresDialog {
                        FailuresListBox = { ItemsSource = result.Failures }
                    };
                    session.UpdateContent(failuresDialog);
                }));
            }
            else
            {
                await progressBar.Dispatcher.BeginInvoke(new Action(session.Close));
            }
            CanRefresh = true;
            await RunRefresh();
        }
예제 #2
0
 private async void StartCleaning(ProgressBar progressBar, DialogSession session)
 {
     var callback =
         new Progress<int>(
             i => { progressBar.Dispatcher.BeginInvoke(new Action(() => { progressBar.Value = i; })); });
     var result = await cleanerService.CleanAsync(currentResult, callback);
     if (result.Failures.Count > 0)
         await progressBar.Dispatcher.BeginInvoke(new Action(() =>
         {
             var failuresDialog = new FailuresDialog {FailuresListBox = {ItemsSource = result.Failures}};
             session.UpdateContent(failuresDialog);
         }));
     else
         await progressBar.Dispatcher.BeginInvoke(new Action(session.Close));
     CanRefresh = true;
     await RunRefresh();
 }