Using DockSiteLayoutSerializer

Docking/MDI for WPF Forum

Posted 2 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 2 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 (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.