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

DocumentPane inside ToolWindow

4 Answers 60 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Mary
Top achievements
Rank 1
Mary asked on 02 Jun 2016, 11:49 AM

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.

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 07 Jun 2016, 07:53 AM
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.
0
Mary
Top achievements
Rank 1
answered on 10 Jun 2016, 05:07 AM

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?

0
Accepted
Yana
Telerik team
answered on 14 Jun 2016, 11:48 AM
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.
0
Mary
Top achievements
Rank 1
answered on 17 Jun 2016, 06:01 AM
Works great. Thank you.
Tags
Docking
Asked by
Mary
Top achievements
Rank 1
Answers by
Yana
Telerik team
Mary
Top achievements
Rank 1
Share this question
or