protected void OnLoaded(object sender, EventArgs e)
        {
            var wih = new WindowInteropWrapper(this);

            //wih.WindowActivating += (s, ce) => ce.Cancel = true;//prevent window activating
            wih.FilterMessage += FilterMessage;

            if (HostedPane.Items.Count > 0)
            {
                var cntHosted = HostedPane.Items[0] as ManagedContent;
                if (!cntHosted.IsCloseable)
                {
                    DisableXButton();
                }
            }
        }
Ejemplo n.º 2
0
        protected void OnLoaded(object sender, EventArgs e)
        {
            this.ResizeMode = ResizeMode.CanResizeWithGrip;

            WindowInteropWrapper wih = new WindowInteropWrapper(this);

            //wih.WindowActivating += (s, ce) => ce.Cancel = true;//prevent window activating
            wih.FilterMessage += new EventHandler <FilterMessageEventArgs>(FilterMessage);

            if (HostedPane.Items.Count > 0)
            {
                ManagedContent cntHosted = HostedPane.Items[0] as ManagedContent;
                if (!cntHosted.IsCloseable)
                {
                    DisableXButton();
                }
            }
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 5
0
        protected void OnLoaded(object sender, EventArgs e)
        {
            WindowInteropWrapper wih = new WindowInteropWrapper(this);

            //wih.WindowActivating += (s, ce) => ce.Cancel = true;//prevent window activating
            wih.FilterMessage += new EventHandler<FilterMessageEventArgs>(FilterMessage);

            if (HostedPane.Items.Count > 0)
            {
                ManagedContent cntHosted = HostedPane.Items[0] as ManagedContent;
                if (!cntHosted.IsCloseable)
                {
                    DisableXButton();
                }
            }
        }