示例#1
0
        public void AddFilterTab(IThumbnailListFilter filter, string filterName)
        {
            CheckDisposedState();

            var text = new TextBlock();

            text.TextTrimming = TextTrimming.CharacterEllipsis;
            text.Text         = filterName;

            var filterButton = new RadioButton();

            filterButton.Content = text;
            filterButton.Click  += FilterTabButtonClickHandler;
            filterButton.Style   = (Style)FindResource("TabStyle");

            _filterTabs.Add(new FilterTab(filter, filterName, filterButton));
        }
示例#2
0
        public FilterTab(IThumbnailListFilter filter, string filterName, RadioButton filterButton)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }
            if (filterName == null)
            {
                throw new ArgumentNullException("filterName");
            }
            if (filterButton == null)
            {
                throw new ArgumentNullException("filterButton");
            }

            _filter       = filter;
            _filterName   = filterName;
            _filterButton = filterButton;
            _curPageIndex = 0;

            _filterStorage.Add(_filterButton, this);
        }
示例#3
0
        public int ApplyFilter(IThumbnailListFilter filter)
        {
            ExecutionEngine.EventLogger.Write("ThumbnailList:ApplyFilter");
            CheckDisposedState();

            _thumbnailsLoader.Stop();
            _filteredItems.Clear();

            foreach (ThumbnailItem item in _items)
            {
                if (filter.Includes(item))
                {
                    _filteredItems.Add(item);
                }
            }

            _lastAppliedFilter = filter;

            _firstVisibleItemIndex = 0;

            return(_filteredItems.Count);
        }