Пример #1
0
 private void PluginView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (e.NewValue is AMLTreeViewModel model)
     {
         DisplayName = ActiveDocumentViewModel.DisplayName(model);
     }
 }
Пример #2
0
        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;
                }
            }
        }