Exemplo n.º 1
0
        /// <summary>
        /// This method is used to initialize the view model and can be overriden for customization.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            RegisterImportedLibrariesRessources();

            // register services
            PDEModelingDSLServiceRegistrar.Instance.RegisterServices(this.ViewModelStore);

            // ensure context menu provider are initialized
            if (Tum.PDE.ModelingDSL.ViewModel.ModelTree.PDEModelingDSLModelTreeContextMenuProvider.Instance == null)
            {
                throw new System.ArgumentNullException("Context menu provider");
            }


            foreach (DslEditorModeling::ModelContext modelContext in this.ModelData.AvailableModelContexts)
            {
                if (modelContext.Name == "DefaultContext")
                {
                    DefaultContextModelContextViewModel mDefaultContext = new DefaultContextModelContextViewModel(this.ViewModelStore, modelContext, this);
                    mDefaultContext.InitializeMC();
                    this.AvailableModelModelContextViewModels.Add(mDefaultContext);
                    this.SelectedModelContextViewModel = mDefaultContext;
                }
            }

            this.ModelTreeModel = new PDEModelingDSLModelTreeViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
            AddViewModel(ModelTreeModel);

            this.ErrorListModel = new PDEModelingDSLErrorListViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
            AddViewModel(ErrorListModel);

            this.PropertyGridModel = new PDEModelingDSLPropertyGridViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
            AddViewModel(PropertyGridModel);

            this.DependenciesModel = new PDEModelingDSLDependenciesViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
            AddViewModel(DependenciesModel);

            this.SearchModel = new PDEModelingDSLSearchViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
            AddViewModel(SearchModel);
            AddViewModel(SearchModel.SearchResultViewModel);

            #region Credits + Further Readings
            this.CreditsViewModel        = new DslEditorViewModelData::CreditsViewModel(this.ViewModelStore);
            this.FurtherReadingViewModel = new DslEditorViewModelData::FurtherReadingViewModel(this.ViewModelStore);


            #endregion
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method is used to initialize the view model and can be overriden for customization.
        /// </summary>
        protected override void Initialize()
        {
			base.Initialize();
			RegisterImportedLibrariesRessources();
			
			// register services
			PDEModelingDSLServiceRegistrar.Instance.RegisterServices(this.ViewModelStore);

			// ensure context menu provider are initialized
			if( Tum.PDE.ModelingDSL.ViewModel.ModelTree.PDEModelingDSLModelTreeContextMenuProvider.Instance == null )
				throw new System.ArgumentNullException("Context menu provider");
		

			foreach(DslEditorModeling::ModelContext modelContext in this.ModelData.AvailableModelContexts)
			{
				if( modelContext.Name == "DefaultContext")
				{
					DefaultContextModelContextViewModel mDefaultContext = new DefaultContextModelContextViewModel(this.ViewModelStore, modelContext, this);
					mDefaultContext.InitializeMC();
					this.AvailableModelModelContextViewModels.Add(mDefaultContext);
					this.SelectedModelContextViewModel = mDefaultContext;
				}
			}
			
			this.ModelTreeModel = new PDEModelingDSLModelTreeViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
			AddViewModel(ModelTreeModel);

			this.ErrorListModel = new PDEModelingDSLErrorListViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
			AddViewModel(ErrorListModel);

			this.PropertyGridModel = new PDEModelingDSLPropertyGridViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
			AddViewModel(PropertyGridModel);

			this.DependenciesModel = new PDEModelingDSLDependenciesViewModel(ViewModelStore as PDEModelingDSLViewModelStore);
			AddViewModel(DependenciesModel);

			this.SearchModel = new PDEModelingDSLSearchViewModel(ViewModelStore as PDEModelingDSLViewModelStore);			
			AddViewModel(SearchModel);
			AddViewModel(SearchModel.SearchResultViewModel);	

			#region Credits + Further Readings
			this.CreditsViewModel = new DslEditorViewModelData::CreditsViewModel(this.ViewModelStore);
			this.FurtherReadingViewModel = new DslEditorViewModelData::FurtherReadingViewModel(this.ViewModelStore);

	
			#endregion
		}