Posted 15 years ago
by Bradley

Hopefully there's a document somewhere that I'm just missing. I've got 2 custom DocumentWindows, WorkSpaceWindow and ChartWindow. I have a class called DocumentsView which can host multiple WorkSpaceWindow's via this code
And each WorkSpaceWindow can host multiple ChartWindow's via
All this works fine, but now I want to serialize my layout. Right now I don't care about serializing the data that's in ChartWindow or WorkSpaceWindow, just want to be able to serialize all the WorkSpaceWindow's that are in my DocumentsView, and then any ChartWindow's that are in each of the WorkSpaceWindows. I've added [Serializable()] to the top of both classes, and the code to save the layout is
but when I run this and close the app I get this error on the SaveToFile line
"{"Cannot serialize member System.Windows.Input.InputBinding.Command of type System.Windows.Input.ICommand because it is an interface."}" so I'm pretty sure I'm not doing something right. Thanks!
[Modified at 05/03/2010 08:19 PM]
<docking:DockSite x:Name="WorkspaceDockSite" CanDocumentWindowsEditTitles="True" >
<docking:Workspace>
<docking:TabbedMdiHost TabPlacement="Bottom">
<docking:TabbedMdiContainer>
</docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:DockSite>
<docking:DockSite x:Name="InnerDockSite" WindowActivated="InnerDockSite_WindowActivated">
<docking:Workspace>
<docking:TabbedMdiHost x:Name="tabbedMdiHost" TabPlacement="Top">
<docking:TabbedMdiContainer>
</docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:DockSite>
if (layoutSerialize == null)
layoutSerialize = new DockSiteLayoutSerializer();
//Just WorkSpaceWindow till that type works
layoutSerialize.CustomTypes.Add(typeof(WorkSpaceWindow));
layoutSerialize.SaveToFile(@"C:\layout.mqtd", WorkspaceDockSite);
"{"Cannot serialize member System.Windows.Input.InputBinding.Command of type System.Windows.Input.ICommand because it is an interface."}" so I'm pretty sure I'm not doing something right. Thanks!
[Modified at 05/03/2010 08:19 PM]