You can right click on a tab in the XamDockManager and toggle between a tabbed document and a floating window. How can I do this in C# so I can execute this behavior from a button click.
I added the DataTemplate (I set the background to red to easily see it) to the ToolWindow (I set in OnToolWindowLoaded) ContentTemplate. All it did was change the top line of the content in the tool window but didnt change the tool window header. The tool window doesnt have a header template, the split window doesnt have a header template, and I changed the header template of the content pane, no luck.
Where is the world is the header content for the tool window?
In order to retemplate the PaneToolWindow ( the floating window) you would have to set its UseOSNonClientArea to false. Yu can do this in the ToolWindowLoaded event of the XamDockManager :
private
void xamDockManager1_ToolWindowLoaded(object sender,PaneToolWindowEventArgs e){
window.UseOSNonClientArea =
false;
}
Then you can apply a template to the window (ContentTemplate property) and put the button you want to toggle the pane's state there. However, please note that the content of the PaneToolWindow is a SplitPane, as you can dock multiple panes in one PaneToolWindow. In order to toggle the state, you would either have to set the CommandTarget property if you are using a command or find the content pane in the SplitPane's Panes collection and toggle its state in the Click event. Here is how you can do this with a command :
<
DataTemplate x:Key="toolWindowTemplate">
<DockPanel>
<Button DockPanel.Dock="Top" Width="20" Height="20" Content="X"
CommandTarget="{Binding Panes[0]}"
Command="{x:Static igDock:ContentPaneCommands.ToggleDockedState}"/>
<ContentPresenter DockPanel.Dock="Top" Content="{Binding}"/>
</DockPanel>
</DataTemplate>
I thought I had the infragistics controls down but this floating window has me stumped. I now can click a button in the tab header and successfully float the window. Now I need to add a button to the header in the floating window to unfloat it. I can change the header in the docked windows but not the floating window. How do I add a button to the header of the floating window.
I believe these properies are intended for the SplitPane panes. What you can do is to handle the ToolWindowOpening event and use them to set the size/location on the newly loaded split pane :
private void xamDockManager1_ToolWindowLoaded(object sender, Infragistics.Windows.DockManager.Events.PaneToolWindowEventArgs e)
{
XamDockManager.SetFloatingSize(e.Window.Pane
, new Size(700, 700));
XamDockManager.SetFloatingLocation(e.Window.Pane, new Point(20, 20));
ContentPaneCommands.ChangeToFloatingOnly works to float the window but the window always comes up in the small possible size. I have tried
XamDockManager.SetFloatingLocation(pane, new Point(20, 20));
XamDockManager.SetFloatingSize(pane, new Size(300, 200));
both before and after the ExecuteCommand but the window doesn't size. How can i set the size of the floated tab window?