Example #1
0
        private async void ResetValues()
        {
            ValuesRetrievalInProgress = true;
            Values.CollectionChanged -= ValuesChanged;
            Values.Clear();
            if (await _cachingService.CacheExists())
            {
                foreach (var value in (await _apiService.GetValueModelsAsync()).OrderBy(e => e.Order))
                {
                    Values.Add(value);
                }
                _cachingService.CacheData(Values.ToList());
            }
            Values.CollectionChanged += ValuesChanged;
            ((RelayCommand)CreateNewValueCommand).RaiseCanExecuteChanged();

            ValuesRetrievalInProgress = false;
        }