We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Restore docking state for invisible dockers

Hello, I'm trying to restore docking state in the system when none of dockers are visible, though they might have been visible during save of persistant docking state. What I've managed to achieve is derive from DockingManager, override ApplyDeserializedState method and before calling base.ApplyDeserializedState modify DockingMgrSerializationWrapper instance. During this modification I explicitly set dock visibility to false. This approach seems to fit my needs, except for flicker during docking state restore. This happens because during this phase dockers are made visible and then hidden again. I've tried to analyze Syncfusion code exhaustively and found out that: "DockHostControllers need to be VISIBLE and have unique dock/float states when applying the persisted layout state." Is there any (even the dirtiest) workaround to avoid this flicker? Is their a way to apply state avoiding of docking host controler visibility change? regards, Ramunas Urbonas

4 Replies

AD Administrator Syncfusion Team September 5, 2003 01:38 PM UTC

Hi Ramunas, The easiest way of doing this would be to handle the NewDockStateEndLoad event and use the SetDockVisibility method to hide the controls. You could use code like : private void dockingManager1_NewDockStateEndLoad(object sender, System.EventArgs e) { this.dockingManager1.SetDockVisibility(this., false); } Please let me know if this helps. Also, we strongly recommend you not to follow the present approach of deriving from the docking manager and overriding ApplyDeserializedState method since it's a very complicated way of doing it. Regards, Guru Patwal.

RU Ramunas Urbonas September 8, 2003 03:49 AM UTC

Hello again, No it does not help. Main problem is deep within ApplyDeserializedState method, since it unhides any invisible dockers during state restore process. There is a comment line which explains this behaviour: // Run through the controller list and un-autohide and un-hide all dockhostcontrollers. Follow this up with a redock/refloat of all controllers housed within docktabs. DockHostControllers need to be visible and have unique dock/float states when applying the persisted layout state. I absolutely must avoid this behaviour, since I cannot allow flickers in production application. Any dirty workarounds will be suitable, till better solution will be found. regards, Ramunas Urbonas

RU Ramunas Urbonas September 8, 2003 11:23 AM UTC

Finally, I did it. Flicker is completele removed. The solution is to use heavy API window lock ( LockWindowUpdate(hWnd) ), which works like charm. The same cannot be said about standard .net methods. regards, Ramunas Urbonas p.s. for those who also strugle with this problem. import API method: [System.Runtime.InteropServices.DllImportAttribute("user32.dll")] private static extern bool LockWindowUpdate( Int64 windowHandle ); Restore state: // lock window. this = MDI window LockWindowUpdate( this.Handle.ToInt64() ); // restore state this.dockingManager.LoadDockState( appSerializer ); // release window LockWindowUpdate( 0 ); Note that only one window can be locked by application at a time.

KL Ken Law February 20, 2005 02:48 PM UTC

Thanks so much for your suggestion. My application was looking frustratingly unprofessional, but the LockWindowUpdate has helped tremendously. Whenever I change "modes" in my application I change to a new set of several controls in auto-hide mode docked to the main form along with a number of tabbed-MDI forms, etc. There was all kinds of flicker going on. Now I''m down to only having the background of the main form flash before the single draw of all the controls and forms. I''ve tried overridding OnPaintBackgound to stop it and I''ve tried using a bitmap background but neither really work. If anyone knows how to stop this single background flash I''d appreciate it. Thanks.

Live Chat Icon For mobile
Up arrow icon