Example #1
0
 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
         );
 }
Example #3
0
 public static Task <DialogActionExecuteEventArgs> WaitForActionAsync(this CustomDialog dialog)
 {
     return(EventAsync.FromEvent <DialogActionExecuteEventArgs>(
                handler => dialog.ExecuteAction += handler,
                handler => dialog.ExecuteAction -= handler
                ));
 }
Example #4
0
 public static async Task <RoutedEventArgs> WaitForClickAsync(this ButtonBase button)
 {
     return(await EventAsync.FromRoutedEvent(
                handler => button.Click += handler,
                handler => button.Click -= handler
                ));
 }