Ejemplo n.º 1
0
        public static Task WaitForLoadedAsync(this FrameworkElement frameworkElement)
        {
            if (frameworkElement == null)
            {
                throw new ArgumentNullException(nameof(frameworkElement));
            }

            return(EventAsync.FromRoutedEvent(handler => frameworkElement.Loaded += handler, handler => frameworkElement.Loaded -= handler));
        }
Ejemplo n.º 2
0
        public static Task WaitForLayoutUpdatedAsync(this FrameworkElement frameworkElement)
        {
            if (frameworkElement == null)
            {
                throw new ArgumentNullException(nameof(frameworkElement));
            }

            return(EventAsync.FromEvent <object>(handler => frameworkElement.LayoutUpdated += handler, handler => frameworkElement.LayoutUpdated -= handler));
        }
Ejemplo n.º 3
0
        public static Task BeginAsync(this Storyboard storyboard)
        {
            if (storyboard == null)
            {
                throw new ArgumentNullException(nameof(storyboard));
            }

            return(EventAsync.FromEvent <object>(handler => storyboard.Completed += handler, handler => storyboard.Completed -= handler, storyboard.Begin));
        }