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
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
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?
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