Пример #1
0
        public ViewModels(ModelsEx models)
        {
            this.models = models;

            // view models
            Display    = new DisplayViewModel(models);
            Progress   = new ProgressViewModel(models);
            Images     = new ImagesViewModel(models);
            Equations  = new EquationsViewModel(models);
            Filter     = new FiltersViewModel(models);
            Statistics = new StatisticsViewModel(models);

            // commands
            OpenCommand   = new OpenCommand(models);
            ImportCommand = new ImportCommand(models);
            ImportEquationImageCommand = new ImportEquationImageCommand(models);
            ExportCommand = new ExportCommand(models);

            ShowPixelDisplayCommand = new ShowPixelDisplayCommand(models);
            ShowPixelColorCommand   = new ShowPixelColorCommand(models);
            ShowScaleCommand        = new ShowScaleCommand(models);
            GenerateMipmapsCommand  = new GenerateMipmapsCommand(models);
            DeleteMipmapsCommand    = new DeleteMipmapsCommand(models);
            HelpCommand             = new HelpDialogCommand(models);
            GifExportCommand        = new GifExportCommand(models);
            ImportArrayCommand      = new ImportArrayCommand(models);
            LatLongToCubemapCommand = new LatLongToCubemapCommand(models);
            CubemapToLatLongCommand = new CubemapToLatLongCommand(models);

            ResizeCommand   = new ResizeWindowCommand(models);
            SetThemeCommand = new SetThemeCommand(models);

            AddFilterCommand = new AddFilterCommand(models, Filter);

            // key input
            models.Window.Window.KeyUp += WindowOnKeyUp;
        }
Пример #2
0
        public WindowViewModel(App app, MainWindow window)
        {
            this.models = new Models.Models(app, window, this);

            // controller
            this.paintController = new PaintController(models);

            // model views
            Images     = new ImagesViewModel(models, this);
            Display    = new DisplayViewModel(models);
            Equations  = new EquationsViewModel(models);
            Progress   = new ProgressViewModel(models);
            Filter     = new FiltersViewModel(models);
            Statistics = new StatisticsViewModel(models);

            // commands
            var import = new ImportImageCommand(models, this);

            ImportCommand = import;
            ResizeCommand = new ResizeWindowCommand(models);
            ImportEquationImageCommand = new ImportEquationImageCommand(models);
            OpenCommand             = new OpenImageCommand(models, import);
            ExportCommand           = new ExportImageCommand(models);
            AddFilterCommand        = new AddFilterCommand(models, Filter);
            ShowPixelDisplayCommand = new ShowPixelDialogCommand(models);
            ShowPixelColorCommand   = new ShowPixelColorCommand(models);
            GenerateMipmapsCommand  = new GenerateMipmapsCommand(models);
            DeleteMipmapsCommand    = new DeleteMipmapsCommand(models);

            window.KeyUp += WindowOnKeyUp;
            models.GlContext.GlControl.DragDrop += GlControlOnDragDrop;

            HelpAboutCommand        = new HelpCommand("help\\about.md");
            HelpEquationCommand     = new HelpCommand("help\\equation.md");
            HelpFilterManualCommand = new HelpCommand("help\\filter_manual.md");
        }