DocumentPane inside ToolWindow

5 posts, 1 answers
  1. Mary
    Mary avatar
    5 posts
    Member since:
    May 2016

    Posted 02 Jun Link to this post

    Hi,

    I have a DocumentHost with a couple of DocumentPanes. When I drag a pane out it becomes a tool window. I want the tool window to have that documentpane inside it when in floating state (Example: Visual Studio). This is achievable in WinForms (Pic attached). Please guide me if it can be achieved in WPF as well.

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 07 Jun Link to this post

    Hello Mary,

    You could subscribe to PaneStateChange event of RadDocking and in its handler set TabStripPlacement property of the PaneGroup holding the Pane to Top like this:

    private void dockEngineering_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        var pane = e.OriginalSource as RadPane;
        if (pane.IsFloating == true)
        {
            if(pane.PaneGroup != null && pane.PaneGroup.TabStripPlacement != Dock.Top)
                pane.PaneGroup.TabStripPlacement = Dock.Top;
        }
    }

    I hope this would be helpful.

    Regards,
    Yana
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Mary
    Mary avatar
    5 posts
    Member since:
    May 2016

    Posted 10 Jun in reply to Yana Link to this post

    Thank you. Its working great. There are two concerns however:

    1. I am working with both RadPanes and RadDocumentPanes. When I add the above code, its applied to all the panes, whereas I want only the RadDocumentPanes to behave this way when in Float state. How can I achieve that?

    2. When I float the DocumentPanes, an extra close button appears. (Please see attached pic). The close button position has been kept InPane. Is there a way to remove the extra close button?

  5. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 14 Jun Link to this post

    Hi Mary,

    1. You could add one more check for the type of the Pane like this:

    private void dockEngineering_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        var pane = e.OriginalSource as RadDocumentPane;
        if (pane != null && pane.IsFloating == true)
        {
            if (pane.PaneGroup != null && pane.PaneGroup.TabStripPlacement != Dock.Top)
                pane.PaneGroup.TabStripPlacement = Dock.Top;                  
        }
    }

    2. In order to remove the Close button, you will need to edit the TopTemplate of RadPaneGroup. The easiest way is to extract the template as explained here and remove the RadButton with x:Name="CloseButton". I have attached a sample project to demonstrate it, note that I've used Implicit Styles to set a theme to RadDocking as this approach helps make such customizations easier.

    Hope this helps.

    Regards,
    Yana
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Mary
    Mary avatar
    5 posts
    Member since:
    May 2016

    Posted 17 Jun in reply to Yana Link to this post

    Works great. Thank you.
Back to Top
UI for WPF is Visual Studio 2017 Ready