public void initialize(ObservableCollection <Card> parentDataSet, ListView cardItemListView)
        {
            this.cardItemsList = cardItemListView;

            this.baseDataSet    = new CardItemObservableCollection(parentDataSet);
            this.cardItemSorter = new CardItemSorter <ISortableCardItem>(this.baseDataSet);
            updateShownDataSet();

            alphabetSort_Clicked(null, null);
            modTimeFrame.Opacity = .5;
        }
Example #2
0
        private void updateShownDataSet()
        {
            bool sortAscending = (cardItemSorter == null ? false : cardItemSorter.sortAscending);

            if (showOnlyFavorites)
            {
                ObservableCollection <ISortableCardItem> favDataSet = new ObservableCollection <ISortableCardItem>(baseDataSet.Where(x => x.isFavorited));

                this.cardItemSorter            = new CardItemSorter <ISortableCardItem>(hideAlphaSort, sortAscending, this.sortTypeLabel, favDataSet);
                this.cardItemsList.ItemsSource = favDataSet;
            }
            else
            {
                this.cardItemSorter            = new CardItemSorter <ISortableCardItem>(hideAlphaSort, sortAscending, this.sortTypeLabel, baseDataSet);
                this.cardItemsList.ItemsSource = baseDataSet;
            }
            this.cardItemsList.Focus();
        }