This is a migrated thread and some comments may be shown as answers.

Center a floating SplitContainer in the main window

1 Answer 109 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Pascal GUERY
Top achievements
Rank 1
Pascal GUERY asked on 08 Jan 2014, 07:51 PM
Hi,

I am developing a WPF application in my company.
The main window contains a Docking control.
UserControls are displayed in floating Panes at run time.
A floating Pane in the application is the only Pane in its PaneGroup and the PaneGroup is the only PaneGroup in its SplitContainer.
I use the RadPane.MakeFloatingDockable method to make a Pane floating but the Pane is initially displayed in the top left corner of the main window.
What do I need to do to initially display a floating Pane in the center of the main window ?

Thank you in advance for your help

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 13 Jan 2014, 09:42 AM
Hi Pascal,

In order to change the position of the Floating Pane you will need to get its parent of type ToolWindow and change its Top and Left properties as required. Please check the following code snippet:

...
this.Pane.MakeFloatingDockable();
var toolWindow = this.Pane.ParentOfType<ToolWindow>();
if (toolWindow != null)
{
    toolWindow.Top = 500;
    toolWindow.Left = 400;
}
...

Hope this works for you.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Docking
Asked by
Pascal GUERY
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or