예제 #1
0
        private void DisplayPage(int nextPage)
        {
            if (NumPages == 0)
            {
                return;
            }

            CurrentPage = nextPage;
            if (CurrentPage > NumPages)
            {
                CurrentPage = 1;
            }
            else if (CurrentPage < 1)
            {
                CurrentPage = NumPages;
            }

            int iFirst    = ((CurrentPage - 1) * NumGroupsPerPage);
            int iNextPage = iFirst + NumGroupsPerPage;

            if (iNextPage > _allItemsToShow.Count)
            {
                iNextPage = _allItemsToShow.Count;
            }

            ItemsToShow.Clear();
            for (int i = iFirst; i < iNextPage; i++)        // Remember these are groups, not individual items
            {
                ItemsToShow.Add(_allItemsToShow[i]);
            }

            OnPropertyChanged("PageNumberText");
        }
예제 #2
0
        private void RefreshBindingSourceForChart()
        {
            // I need to show top N items sorted by Characteristic, so we use appropriate comparer for sorting
            _tables.Sort(GetComparer());
            _tables.Reverse();

            // and linq to select items needed
            List <TableInfoViewItem> items = _tables
                                             .Take(NumValues.Value)
                                             .Select(x => new TableInfoViewItem(x, _characteristicToDisplay))
                                             .ToList();

            ItemsToShow.Clear();
            foreach (TableInfoViewItem item in items)
            {
                ItemsToShow.Add(item);
            }
        }
예제 #3
0
        void UpdateShownItems()
        {
            ItemsToShow.Clear();

            if (Feeds == null || Feeds.Count <= 0)
            {
                ListViewPlaceholderText = "No Feeds Available";
                return;
            }

            foreach (var item in Feeds.SelectMany(f => f.GetItemsBySearchTerm(SearchTerm)))
            {
                ItemsToShow.Add(item);
            }

            if (ItemsToShow.Count <= 0)
            {
                ListViewPlaceholderText = "No Feeds to Show";
            }
            else
            {
                ListViewPlaceholderText = string.Empty;
            }
        }