namespace Hyperbar.Widget; public class WidgetHostHandler(IMediator mediator, IFactory factory) : INotificationHandler>, INotificationHandler> { public async Task Handle(Started notification, CancellationToken cancellationToken) { if (notification.Value is IWidgetHost host) { if (factory.Create(host) is WidgetContainerViewModel containerViewModel) { await mediator.PublishAsync(new Created(containerViewModel), nameof(WidgetBarViewModel), cancellationToken); } } } public Task Handle(Stopped notification, CancellationToken cancellationToken) { throw new NotImplementedException(); } }