/// <summary> /// Adds a view model as a child model of this view model. /// </summary> /// <param name="viewModel">View model to add to the children collection.</param> public void AddAdditionalViewModel(BaseDiagramSurfaceViewModel viewModel) { this.allDiagramSurfaceModels.Add(viewModel); this.additionalDiagramSurfaceModels.Add(viewModel); this.MainViewModel.AddViewModel(viewModel); }
/// <summary> /// Adds a view model as a child model of this view model. /// </summary> /// <param name="viewModel">View model to add to the children collection.</param> public void AddPluginViewModel(BaseDiagramSurfaceViewModel viewModel) { this.allDiagramSurfaceModels.Add(viewModel); this.pluginDiagramSurfaceModels.Add(viewModel); this.MainViewModel.AddViewModel(viewModel); if (this == this.MainViewModel.SelectedModelContextViewModel) { this.MainViewModel.ShowPluginIfShownBefore(viewModel); } this.OnPropertyChanged("PluginDiagramSurfaceModels"); this.OnPropertyChanged("HasPluginDiagramSurfaceModels"); }
/// <summary> /// Show plugin if it was shown before (layout manager stores the information). /// </summary> /// <param name="viewModel"></param> public override void ShowPluginIfShownBefore(BaseDiagramSurfaceViewModel viewModel) { if (this.LayoutManager != null) this.LayoutManager.ShowWindowBasedOnConfiguraion(viewModel); }