/// <summary> /// Sets view model. /// </summary> /// <param name="viewModel">VM.</param> public virtual void SetViewModel(Tum.PDE.VSPluginDSL.ViewModel.VSPluginDSLMainViewModel viewModel) { try { this.ViewModel = viewModel; this.DataContext = viewModel; viewModel.Ribbon = this.Ribbon; viewModel.RestoreLayout(); } catch (System.Exception ex) { System.Windows.MessageBox.Show("Error during initialization: " + ex.Message); } // Register known windows DslEditorServices::IUIVisualizerService popupVisualizer = ViewModel.GlobalServiceProvider.Resolve <DslEditorServices::IUIVisualizerService>(); popupVisualizer.TryRegister("SelectElementPopup", typeof(DslEditorPopups::SelectElementPopup)); popupVisualizer.TryRegister("DeleteElementsPopup", typeof(DslEditorPopups::DeleteElementsPopup)); popupVisualizer.TryRegister("SelectElementWithRSTypePopup", typeof(DslEditorPopups::SelectElementWithRSTypePopup)); popupVisualizer.TryRegister("SelectRSTypePopup", typeof(DslEditorPopups::SelectRSTypePopup)); /* * try * { * // load plugins * LoadPlugins(); * } * catch (System.Exception ex) * { * System.Windows.MessageBox.Show("Error during plugin loading: " + ex.Message); * }*/ }
/// <summary> /// Register windows.. /// </summary> protected override void RegisterWindows() { // Register known windows DslEditorServices::IUIVisualizerService popupVisualizer = MainViewModel.GlobalServiceProvider.Resolve <DslEditorServices::IUIVisualizerService>(); popupVisualizer.TryRegister("SelectElementPopup", typeof(DslEditorPopups::SelectElementPopup)); popupVisualizer.TryRegister("DeleteElementsPopup", typeof(DslEditorPopups::DeleteElementsPopup)); popupVisualizer.TryRegister("SelectElementWithRSTypePopup", typeof(DslEditorPopups::SelectElementWithRSTypePopup)); popupVisualizer.TryRegister("SelectRSTypePopup", typeof(DslEditorPopups::SelectRSTypePopup)); }