public static Task WaitForCloseAsync(this CustomDialog dialog) { return(EventAsync.FromEvent( handler => dialog.Closed += handler, handler => dialog.Closed -= handler )); }
public static async Task WaitForLoadedAsync(this FrameworkElement element) { await EventAsync.FromRoutedEvent( handler => element.Loaded += handler, handler => element.Loaded -= handler ); }
public static Task <DialogActionExecuteEventArgs> WaitForActionAsync(this CustomDialog dialog) { return(EventAsync.FromEvent <DialogActionExecuteEventArgs>( handler => dialog.ExecuteAction += handler, handler => dialog.ExecuteAction -= handler )); }
public static async Task <RoutedEventArgs> WaitForClickAsync(this ButtonBase button) { return(await EventAsync.FromRoutedEvent( handler => button.Click += handler, handler => button.Click -= handler )); }