Problem in RestoreLayout

Nov 18, 2010 at 4:12 AM
Edited Nov 18, 2010 at 4:13 AM


I am working on and following code that I have written for restoring the saved layout. 

 Private Sub mnursetLyout_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)

If System.IO.File.Exists(savefilename) Then


End If

End Sub


Above code doesn’t work for restoring the dockable and document content which was created dynamically at runtime. For that it is written in documentation, we need to handle the callback method.


dockManager.DeserializationCallback += (s, e) =>


   //asserts that content that docking manager is looking for

   //is mynewContent

   Debug.Assert(e.Name == "mynewContent");


   var dockableContent = new DockableContent()


       Name = "mynewContent",

       Title = "New Dock Content!"



   //returns this new content

   e.Content = dockableContent;



I tried to convert above code to but I am getting an error. So, my question is what is the proper way to handle the callback method in