Exemple #1
0
        /// <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>
        /// Sets view model.
        /// </summary>
        /// <param name="viewModel">VM.</param>
        public override void SetViewModel(VSPluginDSLMainViewModel viewModel)
        {
            base.SetViewModel(viewModel);

            // change ribbon behavour so that context tabs that become visible are also selected
            InitRibbonControl();
        }