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 did figure out how to do this and am adding just for reference. Place the number of the tab in the tag field of the content pane then...
contentPane.ExecuteCommand(ContentPaneCommands.ChangeToDocument);
var sortList = new SortedList<int, ContentPane>();
foreach(var item in ProgramTabGroupPane.Items)
{
var pane = item as ContentPane;
if (pane == null) continue;
sortList.Add(int.Parse((string)pane.Tag), pane);
}
ProgramTabGroupPane.Items.Clear();
foreach(var pane in sortList.Values)
ProgramTabGroupPane.Items.Add(pane);
ProgramTabGroupPane.SelectedIndex = int.Parse((string)contentPane.Tag) - 1;
rkcarlin said:Is it possible to reposition the returned tab back to its original position?
No, the information about where the document was is not currently preserved. Instead when the pane is readded to the document area it is inserted as the first tab in the tabgroup containing the current active document. This was done to mimic the behavior of documents in VS 2008 and prior. You may want to submit a suggestion for preserving the document location.
If you use the ToggleDockedState command, the content pane will return to its old docked position.
Found one more problem. After floating the content pane in the ToolWindowPane, I return it with contentPane.ExecuteCommand(ContentPaneCommands.ChangeToDocument). However, it always returns to the first Tab. If someone floats tab 8 I would like to return it to tab 8. This behavior also happens when using right click to float and return the window. I tried setting the contentPane.TabIndex but t doesnt seem to do anything.
Is it possible to reposition the returned tab back to its original position?
I gave up trying to set a template and found the original default ToolWindowPane style. That contained the pane header. From there I was able to successfully modify the the header area.