Medistor reworked to handle ui threading in a cleaner way

This commit is contained in:
TheXamlGuy
2024-01-18 16:54:38 +00:00
parent 7dc125ebc7
commit a3065b25ee
19 changed files with 91 additions and 95 deletions
@@ -4,16 +4,16 @@ namespace Hyperbar.Windows.MediaController;
public class MediaControllerHandler(IMediator mediator,
IServiceScopeProvider<MediaController> scopeProvider,
ICache<MediaController, MediaControllerViewModel> cache) :
ICache<MediaController, MediaControllerViewModel> cache) :
INotificationHandler<Created<MediaController>>
{
public async ValueTask Handle(Created<MediaController> notification,
public async Task Handle(Created<MediaController> notification,
CancellationToken cancellationToken)
{
if (notification.Value is MediaController mediaController)
{
if (scopeProvider.TryGet(mediaController, out IServiceScope? serviceScope))
{
if (serviceScope is not null)
{
if (serviceScope.ServiceProvider.GetService<IFactory<MediaController, MediaControllerViewModel?>>()
@@ -27,8 +27,6 @@ public class MediaControllerHandler(IMediator mediator,
}
}
}
}
}
}
}
}