コード例 #1
0
        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));
            }
        }
コード例 #2
0
 public async void Load()
 {
     Patterns = await _client.Newest();
 }
コード例 #3
0
        protected override Task <List <Pattern> > LoadMoreItemsOverrideAsync(CancellationToken c, uint count)
        {
            var loadMoreItemsOverrideAsync = _client.Newest(this.Count);

            return(loadMoreItemsOverrideAsync);
        }
コード例 #4
0
        public async void Load()
        {
            Patterns = await _client.Newest();

            SelectedItem = Patterns.First(p => p.Id == _selectedItemId);
        }