2010 Vol 2, 3.5 library
I get the error: Data at the root level is invalid. Line 1, position 1.
I created a new app. Copied the dock manager xaml from your first dockmanager sample. Also, I gave the splitpanes a unique name. I added ONLY the following code:
public MainWindow(){InitializeComponent();//this.Closed += new EventHandler(MainWindow_Closed);this.Loaded += new RoutedEventHandler(MainWindow_Loaded); }<void MainWindow_Loaded(object sender, RoutedEventArgs e) {if (File.Exists("layout.xml")) { this.DockManager.LoadLayout("layout.xml"); }}void MainWindow_Closed(object sender, EventArgs e){using (FileStream fs = new FileStream("layout.xml", FileMode.Create, FileAccess.Write)){this.DockManager.SaveLayout(fs); }}
The xml file being created is:
<?xml version="1.0" encoding="utf-8"?><xamDockManager version="10.2.20102.1014"> <contentPanes> <contentPane name="leftEdgeDock" location="DockedLeft" /> <contentPane name="rightEdgeDock" location="DockedRight" /> </contentPanes> <panes> <splitPane name="SplitPane1" splitterOrientation="Vertical" location="DockedLeft"> <contentPane name="leftEdgeDock" /> </splitPane> <splitPane name="SplitPane2" splitterOrientation="Vertical" location="DockedRight"> <contentPane name="rightEdgeDock" /> </splitPane> </panes></xamDockManager>
Hello,
The LoadLayout(Sting) is not meant for setting the file name as string, but rather the whole layout which you can get form the SavaLayout() method as described in the online documentation: http://help.infragistics.com/Help/NetAdvantage/WPF/2010.2/CLR4.0/html/InfragisticsWPF4.DockManager.v10.2~Infragistics.Windows.DockManager.XamDockManager~LoadLayout(String).html
Please let me know if you require any further assistance.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Thanks!