Making sure we don't executer rebuilds while in a separate thread from the UI

This commit is contained in:
Lars Brubaker 2021-05-03 17:58:03 -07:00
parent cc7144f00c
commit 1c9119568f
30 changed files with 218 additions and 128 deletions

View file

@ -31,6 +31,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MatterHackers.Agg.UI;
using MatterHackers.DataConverters3D;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.DesignTools.EditableTypes;
@ -87,8 +88,11 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
});
SourceContainer.Visible = false;
rebuildLock.Dispose();
Parent?.Invalidate(new InvalidateArgs(this, InvalidateType.Children));
UiThread.RunOnIdle(() =>
{
rebuildLock.Dispose();
Parent?.Invalidate(new InvalidateArgs(this, InvalidateType.Children));
});
return Task.CompletedTask;
});
}