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)); }
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); }
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); }