Files
Hyperbar/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerFactory.cs
T
2024-01-15 22:02:30 +00:00

18 lines
512 B
C#

using Windows.Media.Control;
namespace Hyperbar.Windows.MediaController;
public class MediaControllerFactory(IServiceScopeFactory<MediaController> serviceScopeFactory) :
IFactory<GlobalSystemMediaTransportControlsSession, MediaController?>
{
public MediaController? Create(GlobalSystemMediaTransportControlsSession value)
{
if (serviceScopeFactory.Create(value) is MediaController mediaController)
{
return mediaController;
}
return default;
}
}