public static Task RunAsyncOnMainThread(Action action) { var semaphore = new BSemaphore(0, 1); ServiceLocator.DispatcherService.RunOnMainThread(async() => { action.Invoke(); semaphore.Release(); }); return(Task.Run(() => semaphore.WaitOne())); }
public static Task RunAsyncOnMainThread(Action action) { var semaphore = new BSemaphore(0, 1); ServiceLocator.DispatcherService.RunOnMainThread(async () => { action.Invoke(); semaphore.Release(); }); return Task.Run(() => semaphore.WaitOne()); }