Skip to content

WPF-942564: Add details about saving the layout and where to call the SaveDockState on DockingManager #1851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: hotfix/hotfix-v30.1.37
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion wpf/Docking/State-Persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: State Persistence in WPF Docking control | Syncfusion®
description: Learn here all about State Persistence support in Syncfusion® WPF Docking (DockingManager) control and more.
platform: WPF
platform: wpf
control: DockingManager
documentation: ug
---
Expand Down Expand Up @@ -69,6 +69,32 @@ DockingManager1.PersistState = true;

DockingManager1.PersistState = True

{% endhighlight %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When PersistState is set to true, the save operation is handled automatically, as clearly documented. In that case, manually saving the layout becomes redundant. So, why should we explicitly save the layout when PersistState is already enabled?


{% endtabs %}

To Save the AutoPersist state of the DockingManager, call the [SaveDockState](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.DockingManager.html#Syncfusion_Windows_Tools_Controls_DockingManager_SaveDockState) method of the DockingManager in the window closing event.

{% tabs %}

{% highlight C# %}

private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
DockingManager1.SaveDockState();
}

{% endhighlight %}


{% highlight VB %}


Private Sub Window_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
DockingManager1.SaveDockState()
End Sub


{% endhighlight %}

{% endtabs %}
Expand Down