Using DockSiteLayoutSerializer

Docking/MDI for WPF Forum

Posted 8 years ago by Eric Ouellet - Developper, Institut de recherche d'Hydro-Québec
Version: 17.2.0661
Avatar

Actually I do:

string xml = System.IO.File.ReadAllText(path);
var layoutSerializer = new DockSiteLayoutSerializer();

layoutSerializer.SerializationBehavior = DockSiteSerializationBehavior.ToolWindowsOnly;

layoutSerializer.LoadFromString(xml, dockSite);

Everything works but the Serializer does set the DataContext.

Is there a way to load the layout without affecting ToolWindow(s) DataContext? 

Eric Ouellet

Comments (1)

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I don't believe we set the ToolWindow.DataContext property ourselves.  Any changes you see might just be inheriting down the visual tree when the ToolWindow gets added to the visual tree.  I would recommend explicitly setting the DataContext of your ToolWindows to something instead of having it inherit down.  That would keep it fixed when there are layout changes and is a best practice for MVVM usage.


Actipro Software Support

The latest build of this product (v25.1.0) was released 29 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.