How to load the dock layout without the app hanging

Docking/MDI for WPF Forum

Posted 4 years ago by Michael Janulaitis - Corner Bowl Software
Version: 19.1.0684
Avatar

What is best technique to load the layout without the app hanging?  It seems the deserialization takes about 100 ms while the application of the layout takes 150 ms.  My spinner hangs when the layout is being applied which doesn't look good in my opinion.  I'd like my spinner to move until the layout is complete.  Here is my layout code:


                await Task.Run(() =>
                {
                    try
                    {
                        lock (synchObject)
                        {
                            if (s == null)
                            {
                                s = new DockSiteLayoutSerializer();
                                if (File.Exists(DockFilePath))
                                {
                                    s.LoadFromFile(DockFilePath);
                                }
                                else
                                {
                                    s.LoadFromString(Properties.Resources.MainDockManager);
                                }
                            }
                        }
                    }
                    catch (Exception)
                    {

                    }
                });
                lock (synchObject)
                {
                    
                    s?.ApplyTo(dockSite);
                }

[Modified 4 years ago]

Comments (1)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Michael,

Unfortunately I'm not sure what can be done in that regard.  Since the layout is loading and updating UI controls, it all must be done in the UI thread.  There isn't really a way to offload that to a worker thread.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.