How to use XmlDockingWindow?

Docking/MDI for WPF Forum

Posted 1 year ago by rex hui
Version: 17.2.0665
Avatar

If I don't want the LastActiveDateTime to be saved to the xml file during serialization, I assume I should create a class derived from XmlDockingWindow and override ShouldSerializeLastActiveDateTime to return false. Correct?

But how to connect this class to the DockSiteLayoutSerializer?

Thanks.

Comments (4)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Out of curiosity, why wouldn't you want that serialized?  It tracks the order the windows were used so that as something closes, it knows what was last used.

You could probably attach to the DockSiteLayoutSerializer.ObjectSerialized event and in the handler, if the e.Node is a XmlDockingWindow, set its LastActiveDateTime to DateTime.MinValue.


Actipro Software Support

Posted 1 year ago by rex hui
Avatar

Thanks but that is not utilizing the ShouldSerializeLastActiveDateTime?

The reason is that we don't want to save the file if nothing is changed. The LastActiveDateTime will be changed each time even if the windows order are the same.

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

ShouldSerializeLastActiveDateTime is effectively seeing if the date is not MinValue.  That's why I suggested you just set the MinValue to get ShouldSerializeLastActiveDateTime to return false.


Actipro Software Support

Posted 1 year ago by rex hui
Avatar

Ok thank you!

The latest build of this product (v2019.1 build 0681) was released 18 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.