private void PluginView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { if (e.NewValue is AMLTreeViewModel model) { DisplayName = ActiveDocumentViewModel.DisplayName(model); } }
private void INotify_ViewActivated(object sender, ViewActivationEventArgs e) { if (!string.IsNullOrEmpty(e.SynchronActivation)) { ActiveDocumentViewModel.Activate(e.SynchronActivation); } else { var plugIns = Docking.Layout.Descendents().OfType <LayoutContent>(). Where(l => l.Content is PluginViewModel); if (plugIns.Select(l => l.Content).FirstOrDefault(p => ((PluginViewModel)p).Plugin == sender) is PluginViewModel plug) { Docking.ActiveContent = plug; //plug.IsActive = true; } } }