Declined
Last Updated: 19 Jan 2016 07:39 by ADMIN
ADMIN
Dimitar
Created on: 07 Jan 2016 09:03
Category: Dock
Type: Bug Report
0
FIX. RadDock - the floating tool window is not restored to its original position when the form is double clicked and the window state is restored.
To reproduce:
- Add a tool window to RadDock
- Make the tool window floating and double-click its title bar.
- Click the maximaze button.
 
1 comment
ADMIN
Stefan
Posted on: 19 Jan 2016 07:38
Reason for Decline: this is desired behavior and this is how the docking control in Visual Studio work as well. If one needs to implement such behavior this can be achieved using the events of the Form (floating window):

  void radDock1_FloatingWindowCreated(object sender, FloatingWindowEventArgs e)
        {
            if (radDock1.ActiveWindow.Text == "ToolWindow1")
            {
                e.Window.FormElement.TitleBar.DoubleClick -= TitleBar_DoubleClick;
                e.Window.FormElement.TitleBar.DoubleClick += TitleBar_DoubleClick;

                e.Window.FormElement.TitleBar.MaximizeButton.Click -= MaximizeButton_Click;
                e.Window.FormElement.TitleBar.MaximizeButton.Click += MaximizeButton_Click;
            }
        }

        void MaximizeButton_Click(object sender, EventArgs e)
        {
            if (toolWindow1.Tag == "DoubleClicked")
            {
                RadElement btn = (RadImageButtonElement)sender;
                Form form = (Form)btn.ElementTree.Control;
                form.Location = new System.Drawing.Point(10000, 10000);

                RedockService service = this.radDock1.GetService<RedockService>();
                service.RestoreState(toolWindow1, DockState.Docked, true);
            }
            toolWindow1.Tag = null;
        }

        void TitleBar_DoubleClick(object sender, EventArgs e)
        {
            toolWindow1.Tag = "DoubleClicked";
        }