Example #1
0
        private QuickFilterViewModel CreateAndAddViewModel(BusinessLogic.Filters.QuickFilter quickFilter)
        {
            var viewModel = new QuickFilterViewModel(quickFilter, OnRemoveQuickFilter)
            {
                CurrentDataSource = _currentDataSource
            };

            viewModel.PropertyChanged += QuickFilterOnPropertyChanged;
            _viewModels.Add(viewModel);
            return(viewModel);
        }
Example #2
0
        private void OnRemoveQuickFilter(QuickFilterViewModel viewModel)
        {
            _viewModels.Remove(viewModel);
            _quickFilters.Remove(viewModel.Id);
            viewModel.PropertyChanged -= QuickFilterOnPropertyChanged;

            OnFilterRemoved?.Invoke();

            if (viewModel.IsActive)
            {
                OnFiltersChanged?.Invoke();
            }
        }