Beispiel #1
0
        private async void LoadPublishersAsync()
        {
            try
            {
                var publishers = await _siService.GetPublishersAsync();

                Publishers = new[] { All, new NamedObject {
                                         ID = -1, Name = null
                                     } }.Concat(publishers).ToArray();
                if (_publishers.Length > 0)
                {
                    // Без асинхронной загрузки пакетов

                    if (DefaultPublisher != null)
                    {
                        _currentPublisher = _publishers.FirstOrDefault(p => p.Name == DefaultPublisher) ?? _publishers[0];
                    }
                    else
                    {
                        _currentPublisher = _publishers[0];
                    }

                    OnPropertyChanged(nameof(CurrentPublisher));
                }

                LoadTagsAsync();
            }
            catch (Exception exc)
            {
                Error?.Invoke(exc);
                IsLoading = false;
            }
        }
Beispiel #2
0
 public async void Load()
 {
     try
     {
         Publishers = (await _siStorageService.GetPublishersAsync()).Select(named => named.Name).ToArray();
         Tags       = (await _siStorageService.GetTagsAsync()).Select(named => named.Name).ToArray();
     }
     catch (Exception exc)
     {
         Trace.TraceWarning(exc.ToString());
     }
 }