Center a floating SplitContainer in the main window

2 posts, 0 answers
  1. Pascal GUERY
    Pascal GUERY avatar
    38 posts
    Member since:
    Apr 2010

    Posted 08 Jan 2014 Link to this post

    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
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 13 Jan 2014 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top