Esempio n. 1
0
        private void FilterTabButtonClickHandler(object sender, RoutedEventArgs e)
        {
            RadioButton button = sender as RadioButton;

            if (button != null)
            {
                FilterTab filterTab = FilterTab.GetFilterTab(button);
                ActivateFilterTab(filterTab);
            }
        }
Esempio n. 2
0
        private void ActivateFilterTab(FilterTab filterTab)
        {
            if (filterTab != null)
            {
                if (_currentFilterTab != null)
                {
                    _currentFilterTab.CurrentPageIndex = _list.CurrentPageIndex;
                }

                _currentFilterTab = filterTab;

                if (filterTab.Filter is PaperSizeFilter)
                {
                    PaperSizeFilter filter = filterTab.Filter as PaperSizeFilter;
                    ExecutionEngine.Instance.SelectedPaperFormat = filter.PaperFormat;
                }
                else
                {
                    ExecutionEngine.Instance.SelectedPaperFormat = null;
                }

                _list.ApplyFilter(_currentFilterTab.Filter);

                if (_list.FilteredItems.Count == 0 && !(filterTab.Filter is ApplyAllFilter))
                {
                    ActivateFilterTab(_filterTabs[0]);
                }

                if (_currentFilterTab.CurrentPageIndex <= _list.MaxPageIndex)
                {
                    GoToPageByIndex(_currentFilterTab.CurrentPageIndex);
                }
                else
                {
                    GoToPageByIndex(_list.CurrentPageIndex);
                }

                UpdatePageIndexList();
                UpdatePagesInfo();
                UpdateTabsVisibility();

                _currentFilterTab.FilterButton.IsChecked = true;
            }
        }