Skip to content

Commit

Permalink
Fix isssue with highlight rectangle not showing up
Browse files Browse the repository at this point in the history
When the control locator is configured to show highlight rectangle, there is no highlight rectangle visible for control bounding box. This is because instance of highlight rectangle should be created on UI thread. We are not forcing initilization immediately after binding happens to ensure intance is created on UI thread.
  • Loading branch information
Nfactor26 committed Dec 23, 2022
1 parent d28c427 commit 532bc4a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using Ninject.Extensions.Conventions;
using Ninject;
using Ninject.Extensions.Conventions;
using Ninject.Modules;
using Pixel.Automation.Core.Interfaces;
using System.Reflection;

namespace Pixel.Automation.Designer.ViewModels.Modules
{
internal class NativeModules : NinjectModule
{
private ICollection<Assembly> assemblies = new List<Assembly>();
private List<Assembly> assemblies = new ();

public NativeModules(IEnumerable<Assembly> assemblies)
{
Expand All @@ -20,6 +22,8 @@ public override void Load()
foreach(var assembly in assemblies)
{
Kernel.Bind(x => x.From(assembly).SelectAllClasses().BindAllInterfaces().Configure(b => b.InSingletonScope()));
//HighlightRectangle instance must be created on UIThread or it won't display
_ = Kernel.Get<IHighlightRectangle>();
}
}
}
Expand Down

0 comments on commit 532bc4a

Please sign in to comment.