예제 #1
0
 protected override void OnClick()
 {
     if (Command is IAsyncCommand asyncCommand)
     {
         _busy.Task(async() => {
             try {
                 SetValue(IsProcessingPropertyKey, true);
                 using (_cancellation = new CancellationTokenSource())
                     using (_taskbar = TaskbarService.Create(1200)) {
                         await _commandInvoke.Invoke(asyncCommand, this, _cancellation.Token, CommandParameter);
                         if (_commandPercentageProgress)
                         {
                             // Report(new AsyncProgressEntry(Progress.Message, 1d));
                             Report(AsyncProgressEntry.Finished);
                         }
                     }
             } catch (Exception e) when(e.IsCanceled())
             {
             } catch (Exception e) {
                 NonfatalError.Notify("Unhandled error", e);
             } finally {
                 _cancellation = null;
                 SetValue(IsProcessingPropertyKey, false);
             }
         }).Forget();
     }
     else
     {
         base.OnClick();
     }
 }
예제 #2
0
 protected override TaskbarHolder GetTaskbarProgress()
 {
     return(TaskbarService.Create(5));
 }
예제 #3
0
 protected override TaskbarHolder GetTaskbarProgress()
 {
     return(TaskbarService.Create("Loading cars", 5));
 }
예제 #4
0
 protected override TaskbarHolder GetTaskbarProgress()
 {
     return(TaskbarService.Create("Loading tracks", 4.9));
 }