Esempio n. 1
0
 public void Execute(object parameter)
 {
     CommandStart?.Invoke(this, new EventArgs());
     Task.Run(() =>
     {
         try
         {
             InternalExecute(parameter);
         }
         catch (OperationCanceledException ex)
         {
             CurrrentMessage = "Operation cancelled: " + ex.Message;
         }
         catch (Exception ex)
         {
             CurrrentMessage = "Exception occured: " + ex.Message;
         }
     }).ContinueWith
         (a =>
         CommandEnd?.Invoke(this, new EventArgs())
         );
 }