Пример #1
0
        /// <summary>
        /// Toggles the value of the dto's locked state
        /// Returns void because RelayCommand expects void as return value
        /// </summary>
        /// <param name="dto">The dto, the lock button belongs to</param>
        private async void OnLockCommand()
        {
            try
            {
                IsLoading = true;
                await _lookupApiService.ToggleLockStateById(SelectedItem.Value.Id);

                SelectedItem.Value.Locked = !SelectedItem.Value.Locked;
                await ReloadList();
            }
            catch (Exception e)
            {
                _loggingService.LogError($"Error during Locking of {typeof(T).ToString()}.", e);
                _dialogService.ShowError(e.Message);
            }
            finally
            {
                IsLoading = false;
            }
        }