public QuickFilterViewModel(QuickFilter quickFilter, Action<QuickFilterViewModel> onRemove)
        {
            if (quickFilter == null) throw new ArgumentNullException("quickFilter");
            if (onRemove == null) throw new ArgumentNullException("onRemove");

            _quickFilter = quickFilter;
            _removeCommand = new DelegateCommand(() => onRemove(this));

            UpdateValidity();
        }
 /// <summary>
 ///     Adds a new quickfilter.
 /// </summary>
 /// <returns></returns>
 public QuickFilter Add()
 {
     lock (_syncRoot)
     {
         var settings = new Settings.QuickFilter();
         var filter = new QuickFilter(settings);
         _quickFilters.Add(filter);
         _settings.Add(settings);
         return filter;
     }
 }
Exemple #3
0
 /// <summary>
 ///     Adds a new quickfilter.
 /// </summary>
 /// <returns></returns>
 public QuickFilter Add()
 {
     lock (_syncRoot)
     {
         var settings = new Core.Settings.QuickFilter();
         var filter   = new QuickFilter(settings);
         _quickFilters.Add(filter);
         _settings.Add(settings);
         return(filter);
     }
 }
 private QuickFilterViewModel CreateAndAddViewModel(QuickFilter quickFilter)
 {
     var viewModel = new QuickFilterViewModel(quickFilter, OnRemoveQuickFilter)
         {
             CurrentDataSource = _currentDataSource != null ? _currentDataSource.DataSource : null
         };
     viewModel.PropertyChanged += QuickFilterOnPropertyChanged;
     _viewModels.Add(viewModel);
     return viewModel;
 }