예제 #1
0
        public MainWindowViewModel(MainWindow mainWindow)
        {
            ProcessingUserControl processingUserControl = new ProcessingUserControl(mainWindow);

            ProcessingUserControlViewModel           = processingUserControl.ViewModel;
            mainWindow.userControlProcessing.Content = processingUserControl;

            mainWindow.comboBoxTheme.ItemsSource = ThemeManager.Current.BaseColors;
            mainWindow.comboBoxColor.ItemsSource = ThemeManager.Current.ColorSchemes;

            string theme = mainWindow.comboBoxTheme.SelectedItem.ToString();
            string color = mainWindow.comboBoxColor.SelectedItem.ToString();

            ChangeTheme(theme, color, false);
        }
        public ProcessingUserControlViewModel(MainWindow mainWindow, ProcessingUserControl userControl)
        {
            EnabledFilters = new List <ImageEffect>();
            Filters        = new List <ImageEffect>
            {
                { new ImageEffect(FilterType.Invert, "Invert Image") },
                { new ImageEffect(FilterType.SepiaTone, "Sepia Tone") },
                { new ImageEffect(FilterType.Emboss, "Emboss") },
                { new ImageEffect(FilterType.Emboss45Degree, "Emboss 45 Degree") },
                { new ImageEffect(FilterType.EmbossTopLeft, "Emboss Top Left") },
                { new ImageEffect(FilterType.EmbossIntense, "Emboss Intense") },
                { new ImageEffect(FilterType.Pixelate, "Pixelate", 1, 100, 1) },
                { new ImageEffect(FilterType.Median, "Median", 3, 19, 2) },
                { new ImageEffect(FilterType.BoxBlur, "Box Blur", 3, 19, 2) },
                { new ImageEffect(FilterType.GaussianBlur, "Gaussian Blur", 1, 100, 1) },
                { new ImageEffect(FilterType.EdgeDetection, "Edge Detection") },
                { new ImageEffect(FilterType.EdgeDetection45Degree, "Edge Detection 45 Degree") },
                { new ImageEffect(FilterType.EdgeDetectionHorizontal, "Edge Detection Horizontal") },
                { new ImageEffect(FilterType.EdgeDetectionVertical, "Edge Detection Vertical") },
                { new ImageEffect(FilterType.EdgeDetectionTopLeft, "Edge Detection Top Left") }
            };

            MaximumHue   = 360;
            Contrast     = 1;
            Gamma        = 1;
            showChanges  = true;
            PixelColor   = Color.FromArgb(255, 255, 0, 0);
            imageEffects = true;

            MainWindow    = mainWindow;
            UserControl   = userControl;
            manipulation  = new Manipulation();
            fileOperation = new FileOperation();

            manipulation.ImageFinished += OnImageFinished;
        }