Skip to content

Commit abfb168

Browse files
authored
Update DIToolkitPackage.cs
create and add commands on the main UI thread to support package background loading
1 parent ee9b1ad commit abfb168

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Core/Shared/DIToolkitPackage.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
5454
.Where(x => typeof(BaseDICommand).IsAssignableFrom(x.ImplementationType))
5555
.ToList();
5656

57+
await JoinableTaskFactory.SwitchToMainThreadAsync();
58+
5759
foreach (var command in commands)
5860
{
5961
var baseCommandTypeGeneric = typeof(CommandWrapper<>).MakeGenericType(command.ImplementationType);

0 commit comments

Comments
 (0)