public MainPage() { this.InitializeComponent(); FiltersDefinitions.prepareFiltersDefinitions(); filtersStack = new FiltersStack(); filtersStack.Add(FiltersDefinitions.getFilter(FiltersDefinitions.FiltersDef.BRIGHTNESS)); filtersStack.Add(FiltersDefinitions.getFilter(FiltersDefinitions.FiltersDef.EDGES_SOBEL_HORIZONTAL_3x3)); filtersStack.Add(FiltersDefinitions.getFilter(FiltersDefinitions.FiltersDef.TRESHOLD)); filtersStack.afterUpdate += updateUsedFiltersPanel; updateUsedFiltersPanel(); FiltersList = FiltersDefinitions.getFiltersNames(); SelectedFilter = FiltersList.First(); }
private void UseFilter_Click(object sender, RoutedEventArgs e) { var filterName = Filters_ComboBox.SelectedValue as string; if (filterName == null) { return; } ; Filter selectedfilter = FiltersDefinitions.getFilter(filterName); if (selectedfilter != null) { filtersStack.Add(selectedfilter); if (autoPreview_Switch.IsOn) { filter_click(sender, e); } } }