static object OnCoerceValueContentProperty(DependencyObject d, object baseValue)
        {
            DocumentFloatingWindow fl = ((DocumentFloatingWindow)d);

            if (fl.Content != null)
            {
                throw new InvalidOperationException("Content on floating windows can't be set more than one time.");
            }

            if (!(baseValue is DocumentContent))
            {
                throw new InvalidOperationException("Content must be of type DocumentContent");
            }

            FloatingDocumentPane paneToReturn = null;

            if (baseValue is DocumentContent)
            {
                paneToReturn = new FloatingDocumentPane(fl, baseValue as DocumentContent);
            }

            return(paneToReturn);
        }
        /// <summary>
        /// Close this content without notifications
        /// </summary>
        internal void InternalClose()
        {
            this.LastActivation = DateTime.MinValue; // make this content ineligible for ActiveDocument selection when ActiveDocument is set to null
            DockingManager manager = Manager;

            if (manager != null)
            {
                if (manager.ActiveContent == this)
                {
                    manager.ActiveContent = null;
                }

                if (manager.ActiveDocument == this)
                {
                    manager.ActiveDocument = null;
                }
            }

            DocumentPane         parentPane         = ContainerPane as DocumentPane;
            FloatingDocumentPane floatingParentPane = ContainerPane as FloatingDocumentPane;

            if (floatingParentPane != null)
            {
                floatingParentPane.RemoveContent(0);
                if (floatingParentPane.FloatingWindow != null &&
                    !floatingParentPane.FloatingWindow.IsClosing)
                {
                    floatingParentPane.FloatingWindow.Close();
                }
            }
            else if (parentPane != null)
            {
                parentPane.Items.Remove(this);

                parentPane.CheckContentsEmpty();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Close this content without notifications
        /// </summary>
        internal void InternalClose()
        {
            DockingManager manager = Manager;

            if (manager != null)
            {
                if (manager.ActiveContent == this)
                {
                    manager.ActiveContent = null;
                }

                if (manager.ActiveDocument == this)
                {
                    manager.ActiveDocument = null;
                }
            }

            DocumentPane         parentPane         = ContainerPane as DocumentPane;
            FloatingDocumentPane floatingParentPane = ContainerPane as FloatingDocumentPane;

            if (floatingParentPane != null)
            {
                floatingParentPane.RemoveContent(0);
                if (floatingParentPane.FloatingWindow != null &&
                    !floatingParentPane.FloatingWindow.IsClosing)
                {
                    floatingParentPane.FloatingWindow.Close();
                }
            }
            else if (parentPane != null)
            {
                parentPane.Items.Remove(this);

                parentPane.CheckContentsEmpty();
            }
        }
Exemplo n.º 4
0
        static object OnCoerceValueContentProperty(DependencyObject d, object baseValue)
        {
            DocumentFloatingWindow fl = ((DocumentFloatingWindow)d);

            if (fl.Content != null)
            {
                throw new InvalidOperationException("Content on floating windows can't be set more than one time.");
            }

            if (!(baseValue is DocumentContent))
            {
                throw new InvalidOperationException("Content must be of type DocumentContent");
            }

            FloatingDocumentPane paneToReturn = null;

            if (baseValue is DocumentContent)
                paneToReturn = new FloatingDocumentPane(fl, baseValue as DocumentContent);

            return paneToReturn;
        }