Posted 15 years ago
by Craig
-
Nstrument

I setup my docking site like this:
<docking:DockSite x:Name="_dockSite" CanDocumentWindowsRaft="True" >
<docking:Workspace >
<docking:TabbedMdiHost >
<docking:TabbedMdiContainer />
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:DockSite>
In code behind I create document windows like this:
DocumentWindow newContent = new DocumentWindow(_dockSite, "Name", "Title", null, part);
newContent.Tag = part.PartKey;
newContent.Activate();
Than to save my current layout I do this:
DockSiteLayoutSerializer _layoutSerializer = new DockSiteLayoutSerializer();
string xml = _layoutSerializer.SaveToString(_dockSite);
But the Xml it creates contains no entries for the DocumentWindow(s) that I create.
I've ommited some of the attributes in the xml below for clarity:
<DockSiteLayout>
<AutoHideHost>
<AutoHideTabStrip Side="Left">
<ToolWindowContainer>
<UIElement xsi:type="ToolWindowRef" Name="TreeView" />
</ToolWindowContainer>
</AutoHideTabStrip>
<AutoHideTabStrip Side="Right">
<ToolWindowContainer >
<UIElement xsi:type="ToolWindowRef" Name="ToolPanelView" />
</ToolWindowContainer>
</AutoHideTabStrip>
</AutoHideHost>
<Content xsi:type="SplitContainer">
<UIElement xsi:type="Workspace">
<Content xsi:type="TabbedMdiHost">
<Content xsi:type="TabbedMdiContainer" />
</Content>
</UIElement>
<UIElement xsi:type="ToolWindowContainer" >
<UIElement xsi:type="Track" />
</UIElement>
<UIElement xsi:type="ToolWindowContainer" >
<UIElement xsi:type="Track" />
</UIElement>
</Content>
<RaftingHosts />
<ToolWindows>
<ToolWindow Name="ToolPanelView" />
<ToolWindow Name="TreeVie" />
</ToolWindows>
</DockSiteLayout>
It's worth noting that toolwindows do get serialized as the xml shows.
Thanks
Craig.
[Modified at 01/24/2010 02:10 PM]
<docking:DockSite x:Name="_dockSite" CanDocumentWindowsRaft="True" >
<docking:Workspace >
<docking:TabbedMdiHost >
<docking:TabbedMdiContainer />
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:DockSite>
In code behind I create document windows like this:
DocumentWindow newContent = new DocumentWindow(_dockSite, "Name", "Title", null, part);
newContent.Tag = part.PartKey;
newContent.Activate();
Than to save my current layout I do this:
DockSiteLayoutSerializer _layoutSerializer = new DockSiteLayoutSerializer();
string xml = _layoutSerializer.SaveToString(_dockSite);
But the Xml it creates contains no entries for the DocumentWindow(s) that I create.
I've ommited some of the attributes in the xml below for clarity:
<DockSiteLayout>
<AutoHideHost>
<AutoHideTabStrip Side="Left">
<ToolWindowContainer>
<UIElement xsi:type="ToolWindowRef" Name="TreeView" />
</ToolWindowContainer>
</AutoHideTabStrip>
<AutoHideTabStrip Side="Right">
<ToolWindowContainer >
<UIElement xsi:type="ToolWindowRef" Name="ToolPanelView" />
</ToolWindowContainer>
</AutoHideTabStrip>
</AutoHideHost>
<Content xsi:type="SplitContainer">
<UIElement xsi:type="Workspace">
<Content xsi:type="TabbedMdiHost">
<Content xsi:type="TabbedMdiContainer" />
</Content>
</UIElement>
<UIElement xsi:type="ToolWindowContainer" >
<UIElement xsi:type="Track" />
</UIElement>
<UIElement xsi:type="ToolWindowContainer" >
<UIElement xsi:type="Track" />
</UIElement>
</Content>
<RaftingHosts />
<ToolWindows>
<ToolWindow Name="ToolPanelView" />
<ToolWindow Name="TreeVie" />
</ToolWindows>
</DockSiteLayout>
It's worth noting that toolwindows do get serialized as the xml shows.
Thanks
Craig.
[Modified at 01/24/2010 02:10 PM]