public async void Load(int offset = 0) { if (_lastOffset == offset || IsLoading) { return; } _lastOffset = offset; IsLoading = true; _messenger.Publish(new LoadingChangedMessage(this, true)); try { List <Pattern> items = await _client.Newest(offset); foreach (var pattern in items) { Items.Add(pattern); if (!_updatedHighlights) { _messenger.Publish(new HighlightChangedMessage(this)); _updatedHighlights = true; } } } finally { IsLoading = false; _messenger.Publish(new LoadingChangedMessage(this, false)); } }
public async void Load() { Patterns = await _client.Newest(); }
protected override Task <List <Pattern> > LoadMoreItemsOverrideAsync(CancellationToken c, uint count) { var loadMoreItemsOverrideAsync = _client.Newest(this.Count); return(loadMoreItemsOverrideAsync); }
public async void Load() { Patterns = await _client.Newest(); SelectedItem = Patterns.First(p => p.Id == _selectedItemId); }