/// <summary>Creates a new MainWindowViewModel, with dependencies.</summary> public MainWindowViewModel(IFractalRenderer renderer, IImageProvider imageProvider, MainWindow mainWindow, IFractalStore fractals, IColorizationStore colorizers) { this.renderer = renderer; this.mainWindow = mainWindow; AvailableFractals = fractals; AvailableColorizations = colorizers.Select(x => GetViewModel(x)).ToList(); ImageProvider = imageProvider; AsyncLoader = new AsyncLoader(renderer); BoundingBoxProvider = new BoundingBoxProvider(); BoundingBoxProvider.BoxReleased += LoadFractalFromScreenBounds; History = new FractalHistoryProvider(); History.OnBack += OnHistoryBack; Commands = new MainWindowCommands(this); SelectedColorizer = AvailableColorizations.FirstOrDefault(); SelectedFractal = AvailableFractals.FirstOrDefault(); MaximumIterations = 800; }