Example #1
0
        private IDictionary<ViewType, ViewTypeManager<FrameworkElement>> PrepareMapping(ContentManagementService cms, IParameterTransfer parameterTransfer)
        {
            var mapping = new Dictionary<ViewType, ViewTypeManager<FrameworkElement>>();

            mapping[ViewType.Default] = new ViewTypeDefaultManager();
            mapping[ViewType.Test] = new ViewTypeTestManager();

            mapping[ViewType.MainWindow] = new ViewTypeMainWindowManager(cms.OpenLearningPathPromptCommand, cms.OpenExaminationPathWizardCommand, cms.OpenSettingsWindowCommand, cms.ShowAboutWindowCommand, cms.CloseApplicationCommand);

            mapping[ViewType.LearningPathPrompt] = new ViewTypeLearningPathPromptManager(cms.StartLearningPathCommand);
            mapping[ViewType.ExaminationPathWizard] = new ViewTypeExaminationPathWizardManager(vt => { cms.RefreshSecondaryView(ViewType.ExaminationPathWizard, vt); }, cms.HideSecondaryWindowCommand, cms.StartExaminationPathCommand);
            mapping[ViewType.SettingsWindow] = new ViewTypeSettingsWindowManager(cms.OpenPictogramsManagementWizardCommand, cms.OpenCategoriesManagementWizardCommand, cms.OpenCameraCalibrationToolCommand, cms.ReturnToMainWindowCommand);
            mapping[ViewType.AboutWindow] = new ViewTypeAboutManager(cms.HideSecondaryWindowCommand);

            DatabaseService databaseService = new DatabaseService();
            mapping[ViewType.LearningPath] = new ViewTypeLearningPathManager(databaseService, cms.LoadMainPageCommand);
            mapping[ViewType.ExaminationPath] = new ViewTypeExaminationPathManager(cms.ToExaminationPathPipe);

            mapping[ViewType.PictogramsManagementWizard] = new ViewTypePictogramsManagementWizardManager(vt => { cms.RefreshSecondaryView(ViewType.PictogramsManagementWizard, vt); }, cms.HideSecondaryWindowCommand, cms.OpenSettingsWindowCommand);
            mapping[ViewType.CategoriesManagementWizard] = new ViewTypeCategoriesManagementWizardManager(vt => { cms.RefreshSecondaryView(ViewType.CategoriesManagementWizard, vt); }, cms.HideSecondaryWindowCommand, cms.OpenSettingsWindowCommand);
            mapping[ViewType.CalibrationWindow] = new ViewTypeCalibrationManager();

            return mapping;
        }
 public ContentManagementService(IContentChange appViewModel, IParameterTransfer parameterTransfer)
 {
     this.contentChange = appViewModel;
     this.parameterTransfer = parameterTransfer;
     PrepareCommands();
 }