private IList<FunctionalViewModel> CreateViewModels(Configuration configuration) { if (configuration.ModifyMode) { var list = new List<FunctionalViewModel>(3) { new SelectRegionViewModel(configuration), new ModifyRegionViewModel(configuration) }; if (!configuration.UseConfigFile) { list.Insert(0, new SelectFolderViewModel(configuration)); } else { list[0].Reconfigure(configuration); } return list; } else { return new List<FunctionalViewModel>(6) { new ScreensaverViewModel(configuration), new SelectRegionViewModel(configuration), new PaintViewModel(configuration), new ResultViewModel(configuration), new SendEmailViewModel(configuration), new SendCompleteViewModel(configuration) }; } }
protected FunctionalViewModel(Configuration configuration) { Configuration = configuration; BackCommand = new DelegateCommand(Back); NextCommand = new DelegateCommand(Next, CanExecuteNextCommand); HomeCommand = new DelegateCommand<bool?>(Home); ActionCommand = new DelegateCommand<EventInformation<RoutedEventArgs>>(Action); ActionHappened += OnActionHappened; }
private bool IsConfigurationExpected(Configuration configuration, int brushesCount, int regionsCount) { var defaultConfiguration = Configuration.DefaultConfiguration; return configuration.Colors.Count == brushesCount && configuration.Storage.Regions.Count == regionsCount && configuration.HorizontalItemsCount == defaultConfiguration.HorizontalItemsCount && configuration.VerticalItemsCount == defaultConfiguration.VerticalItemsCount && configuration.WaitAnswerInterval == defaultConfiguration.WaitAnswerInterval && configuration.WaitUserActionInterval == defaultConfiguration.WaitUserActionInterval && configuration.WindowHeight == defaultConfiguration.WindowHeight && configuration.WindowWidth == defaultConfiguration.WindowWidth; }
public virtual void Reconfigure(Configuration newConfig) { Configuration = newConfig; }
private void PrepareRegions(Configuration configuration) { foreach (var region in configuration.Storage.Regions) { region.ThumbnailImageName = region.SourceImageName; } }