How to hide a window instead of closing it?

Hi,

I have a window with State.Hidden on the start of the application. After the window is made visible I want it to hide again after the user clicks the X to 'close' it. Is there a setting for this in the DockingManager infrastructure? Or do I have to manually handle this in DockingManager_WindowClosing to set it back to State.Hidden?


1 Reply 1 reply marked as answer

GT Gokul Thanudhas Syncfusion Team April 5, 2022 01:45 PM UTC

Hi Lorenza,

By default, while clicking the close button the window will be moved to Hidden state. The following methods can be used to make a closed window visible.

1.using ExecutingRestore Method


DockingManager1.ExecuteRestore(Content1, DockState.Float);


2. Setting state to the closed window


DockingManager.SetState(content1, DockState.Float);


Please refer to the attached documentation link for your reference

https://help.syncfusion.com/wpf/docking/dealing-with-windows#restore-window-programmatically

https://help.syncfusion.com/wpf/docking/dealing-with-windows#setting-state-for-window-programmatically

Regards,

Gokul T.



Marked as answer
Loader.
Up arrow icon