DockingWindow realizes the memory function through MVVM

Docking/MDI for WPF Forum

Posted 9 months ago by Sunshine - Appeon
Version: 22.1.0
Avatar

I implemented DockingWindow's memory function. I see your Demo doesn't have MVVM implementation. Can you provide the relevant code?

And what is the role of UniqueId and SerializaID? It seems that I can only set SerializaID, so I don't quite understand which property should bind the data to.

Comments (3)

Posted 9 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The DockingWindow.UniqueId is an auto-generated Guid that we use throughout the product to uniquely identify a docking window.  You do not assign this.

The DockingWindow.SerializationId is used as a string you assign to uniquely identify the docking window for layout serialization.  It's something that is meaningful to you, such as a file path for a document, etc.

As for implementing layout serialization when using MVVM, please see this related thread.


Actipro Software Support

Posted 9 months ago by Sunshine - Appeon
Avatar

Thank you very much for your case, now I can save the layout smoothly!

But now we have a new scene that we need to ask how to achieve the goal:

I saved a layout with three windows A, B, C. Then I open D and E again. At this point, I drag the three windows A, B, and C to disrupt their layout, and then I restore the positions of the three windows A, B, and C by restoring the layout, and keep the existing two windows D and E at the same time.

Do you have any preset functions related to this scene or can you tell us how to achieve this effect?

Posted 9 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I assume what you see happen after all that is that after restoring the layout for A, B, and C, you only see those three windows in the layout and D and E are closed.  Is that correct?

If so, you could set IsOpen = true on windows D and E after the layout restore.  That will try and reopen them in the previous dock host they were in and in the same state.  Although since the layout has changed a bit now from when they were previously open, they might end up in a slightly different location.


Actipro Software Support

The latest build of this product (v22.1.4) was released 23 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.