Ejemplo n.º 1
0
 private void FileManager_OperationCompleted(object sender, FileOperationEventArgs e)
 {
     Application.Current.Dispatcher.BeginInvoke((Action)(() =>
     {
         if (_clearFinished)
         {
             FileOperationViewmodel fovm = _operationList.FirstOrDefault(vm => vm.FileOperation == e.Operation);
             if (fovm != null)
             {
                 _operationList.Remove(fovm);
                 fovm.Dispose();
             }
         }
         InvalidateRequerySuggested();
     }), null);
 }
 private void FileManager_OperationCompleted(object sender, FileOperationEventArgs e)
 {
     if (e.Operation == null)
     {
         return;
     }
     Application.Current?.Dispatcher.BeginInvoke((Action)(() =>
     {
         if (_clearFinished && e.Operation.OperationStatus != FileOperationStatus.Failed)
         {
             FileOperationViewmodel fovm = OperationList.FirstOrDefault(vm => vm.FileOperation == e.Operation); // don't remove failed
             if (fovm != null)
             {
                 OperationList.Remove(fovm);
                 fovm.Dispose();
             }
         }
         InvalidateRequerySuggested();
     }));
 }