public override bool WaitOne() { _ewh.WaitOne(); OnSuccessfullWait(); return true; }
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())); }