Ejemplo n.º 1
0
 private void InternalSetActiveContent(LayoutContent currentValue, LayoutContent newActiveContent)
 {
     RaisePropertyChanging("ActiveContent");
     if (currentValue != null)
     {
         currentValue.IsActive = false;
     }
     _activeContent = new WeakReference(newActiveContent);
     currentValue   = ActiveContent;
     if (currentValue != null)
     {
         currentValue.IsActive = true;
     }
     RaisePropertyChanged("ActiveContent");
     _activeContentSet = currentValue != null;
     if (currentValue != null)
     {
         if (currentValue.Parent is LayoutDocumentPane || currentValue is LayoutDocument)
         {
             LastFocusedDocument = currentValue;
         }
     }
     else
     {
         LastFocusedDocument = null;
     }
 }
Ejemplo n.º 2
0
        public int IndexOf(LayoutContent content)
        {
            var anchorableChild = content as LayoutAnchorable;

            if (anchorableChild == null)
            {
                return(-1);
            }

            return(Children.IndexOf(anchorableChild));
        }
Ejemplo n.º 3
0
 internal void OnLayoutElementRemoved(LayoutElement element)
 {
     if (element.Descendents().OfType <LayoutContent>().Any(c => Equals(c, LastFocusedDocument)))
     {
         LastFocusedDocument = null;
     }
     if (element.Descendents().OfType <LayoutContent>().Any(c => Equals(c, ActiveContent)))
     {
         ActiveContent = null;
     }
     ElementRemoved?.Invoke(this, new LayoutElementEventArgs(element));
 }