public SceneEditingEffects(SceneEditingModel model, SceneItemModel item)
        {
            _model = model;
            _item  = item;

            ToggleHFlip = () =>
            {
                var present = GetHflip();
                if (present != null)
                {
                    RemoveFilter(present);
                }
                else
                {
                    AddFilter(new SceneItemFilter {
                        Type = SceneItemFilterType.HFlip, Enabled = true
                    });
                }
            };

            RemoveAll = () =>
            {
                var present = GetHflip();
                if (present != null)
                {
                    _item.Model.Filters = new SceneItemFilters {
                        Filters = new[] { present }
                    }
                }
                ;
                else
                {
                    _item.Model.Filters = null;
                }
            };

            BasicSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Basic).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();
            QuickSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Quick).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();
            CreativeSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Creative).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();


            AllSources = BasicSources.Concat(QuickSources).Concat(CreativeSources).ToList();

            AllSources.ForEach(s => s.InUse.OnChange = (o, n) => SourceChanged(s));

            AddLut = (f, d) => _ = AddResource(f, d);

            UpdateContent(EditingUpdateType.Content);
        }
        public EditSourceFormWindowViewModel(IEventAggregator eventAggregator, IRssStore rssStore)
        {
            _logger.Log("Initialize the viewmodel for edit the sources", Category.Info, Priority.Medium);
            _eventAggregator = eventAggregator;
            AllSources       = rssStore.GetAllSources();

            PreviewEditSourceCommand = new DelegateCommand <Source>(PreviewOneSource);
            RemoveSourceCommand      = new DelegateCommand(RemoveOneSource);
            EditSourceCommand        = new DelegateCommand(EditOneSource, CanExecute).
                                       ObservesProperty(() => NameOfSource).
                                       ObservesProperty(() => CategoryOfSource).
                                       ObservesProperty(() => UriOfSource);

            if (AllSources.Count >= 1)
            {
                SourceToEdit = AllSources.ElementAt(0);
            }
        }
        public void UpdateContent(EditingUpdateType updateType)
        {
            HFlip.SilentValue = GetHflip() != null;

            var filters = GetFiltersModel();

            AllSources.ForEach(s => s.InUse.SilentValue = filters.Any(r => r.Type == s.Desc.Type));

            ListHelper.UpdateCollectionNoId(filters.Where(s => s.Type != SceneItemFilterType.HFlip).ToList(),
                                            Filters,
                                            (s, t) => t.IsTheSame(s),
                                            s => CreateActive(s));

            foreach (var s in  Filters)
            {
                ApplyFilter(s, filters);
            }

            AnyActive.Value = Filters.Any(s => s.IsEnabled.Value);

            UpdateLuts();
        }