Пример #1
0
 /// <summary>
 /// Closes the flyout window
 /// </summary>
 void HideFlyoutWindow()
 {
     if (_flyoutWindow != null && !_flyoutWindow.IsClosing)
     {
         var flWindow = _flyoutWindow;
         _flyoutWindow = null;
         flWindow.Closing -= new System.ComponentModel.CancelEventHandler(OnFlyoutWindowClosing);
         flWindow.Close();
     }
 }
 /// <summary>
 /// Closes the flyout window
 /// </summary>
 void HideFlyoutWindow()
 {
     if (_flyoutWindow != null && !_flyoutWindow.IsClosing)
     {
         _flyoutWindow.Height = 0.0;
         _flyoutWindow.Width = 0.0;
         _flyoutWindow.Close();
         _flyoutWindow = null;
     }
 }
Пример #3
0
        /// <summary>
        /// Shows a flyout window for a content
        /// </summary>
        /// <param name="content">Content to show</param>
        internal void ShowFlyoutWindow(DockableContent content, DockablePaneAnchorTab tabActivating)
        {
            //check if parent window is Active
            Window parentWindow = Window.GetWindow(this);
            if (parentWindow == null || !parentWindow.IsVisible)
                return;

            if (!parentWindow.IsActive && (_flyoutWindow == null || !_flyoutWindow.IsActive))
                return;

            //check if content is already visible in a flyout window
            if (_flyoutWindow != null &&
                _flyoutWindow.ReferencedPane.Items.Contains(content))
            {
                //continue to show the winow
                //_flyoutWindow.KeepWindowOpen();
                return;
            }

            //hide previous window
            HideFlyoutWindow();

            //select this content in the referenced pane
            content.ContainerPane.SelectedItem = content;

            if (_wndInteropWrapper == null)
            {
                _wndInteropWrapper = new WindowInteropWrapper(parentWindow);
                _wndInteropWrapper.WindowPosChanging += (s, e) =>
                    {
                        //update the flyout window
                        UpdateFlyoutWindowPosition();
                    };
            }

            //create e new window
            _flyoutWindow = new FlyoutPaneWindow(this, content);
            _flyoutWindow.Owner = parentWindow;
            _flyoutWindow.FlowDirection = this.FlowDirection;
            _flyoutWindow.ShowActivated = false;
            _flyoutWindow.AnchorTabActivating = tabActivating;

            UpdateFlyoutWindowPosition(true);

            _flyoutWindow.Closing += new System.ComponentModel.CancelEventHandler(OnFlyoutWindowClosing);
            _flyoutWindow.Show();

            //this.Focus();
        }
Пример #4
0
        /// <summary>
        /// Shows a flyout window for a content
        /// </summary>
        /// <param name="content">Content to show</param>
        internal void ShowFlyoutWindow(DockableContent content, DockablePaneAnchorTab tabActivating)
        {
            //check if parent window is Active
            Window parentWindow = Window.GetWindow(this);
            if (parentWindow == null || !parentWindow.IsVisible)
                return;
            
            if (!parentWindow.IsActive && (_flyoutWindow == null || !_flyoutWindow.IsActive))
                return;

            //check if content is already visible in a flyout window
            if (_flyoutWindow != null &&
                _flyoutWindow.ReferencedPane.Items.Contains(content))
            {
                //continue to show the winow
                //_flyoutWindow.KeepWindowOpen();
                return;
            }
            
            // David: This sometimes seems to be null when hovering over auto-hide pad.
            // It only seems to occur in specific circumstances - whether the pad is the
            // "selected" one in the set seems important.  Having no open document might have effect?
            // I have only managed to reliablely reproduce it in stand-alone application.
			if (content.ContainerPane == null)
			{
				return;
			}

            //hide previous window
            HideFlyoutWindow();

            //select this content in the referenced pane
            content.ContainerPane.SelectedItem = content;

            if (_wndInteropWrapper == null)
            {
                _wndInteropWrapper = new WindowInteropWrapper(parentWindow);
                _wndInteropWrapper.WindowPosChanging += (s, e) =>
                    {
                        //update the flyout window
                        UpdateFlyoutWindowPosition();
                    };
            }

            //create e new window
            _flyoutWindow = new FlyoutPaneWindow(this, content);
            _flyoutWindow.Owner = parentWindow;
            _flyoutWindow.FlowDirection = this.FlowDirection;
            _flyoutWindow.ShowActivated = false;
            _flyoutWindow.AnchorTabActivating = tabActivating;
            
            UpdateFlyoutWindowPosition(true);

            _flyoutWindow.Closing += new System.ComponentModel.CancelEventHandler(OnFlyoutWindowClosing);
            _flyoutWindow.Show();

            //this.Focus();
        }