Skip to content

Commit 532bc4a

Browse files
committed
Fix isssue with highlight rectangle not showing up
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.
1 parent d28c427 commit 532bc4a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Pixel.Automation.Designer.ViewModels/Modules/NativeModules.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
using Ninject.Extensions.Conventions;
1+
using Ninject;
2+
using Ninject.Extensions.Conventions;
23
using Ninject.Modules;
4+
using Pixel.Automation.Core.Interfaces;
35
using System.Reflection;
46

57
namespace Pixel.Automation.Designer.ViewModels.Modules
68
{
79
internal class NativeModules : NinjectModule
810
{
9-
private ICollection<Assembly> assemblies = new List<Assembly>();
11+
private List<Assembly> assemblies = new ();
1012

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

0 commit comments

Comments
 (0)