Пример #1
0
 /// <summary>
 /// Edits a dto and sends it to the server to change its value in the database
 /// Returns void because RelayCommand expects void as return value
 /// </summary>
 /// <param name="dto">The dto in the double clicked line</param>
 private async void OnListItemDoubleClickCommand()
 {
     try
     {
         if (SelectedItem != null)
         {
             IsLoading = true;
             var dialogResult = _dialogService.ShowDtoEditorWindow(SelectedItem.Value);
             if (dialogResult != null && dialogResult.Accepted && dialogResult.Value != null)
             {
                 var updateddto = dialogResult.Value;
                 if (!updateddto.Equals(SelectedItem))
                 {
                     await _lookupApiService.Update(updateddto);
                     await ReloadList();
                 }
             }
         }
     }
     catch (Exception e)
     {
         _loggingService.LogError($"Error during Update of {typeof(T).ToString()}.", e);
         _dialogService.ShowError(e.Message);
     }
     finally
     {
         IsLoading = false;
     }
 }