public static void SubscribeOn <T>(this EventChannel eventChannel, DispatcherQueue dispatcherQueue, Action <T> eventHandler) where T : IEvent { eventChannel.Subscribe <T>(t => dispatcherQueue.TryEnqueue(() => eventHandler(t))); }
public static void SubscribeOnUIThread <T>(this EventChannel eventChannel, Action eventHandler) where T : IEvent { eventChannel.Subscribe <T>(_ => App.Window.DispatcherQueue.TryEnqueue(() => eventHandler())); }