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 5 years ago]