Ejemplo n.º 1
0
        private void BubbleEvent(RoutedEventArgs e)
        {
            UIElement target = this;

            while (target != null)
            {
                target.RaiseEventImpl(e);
                target = VisualTreeHelper.GetAncestor <UIElement>(target);
            }
        }
Ejemplo n.º 2
0
        private UIElement FindFocusable(object o)
        {
            UIElement ui = o as UIElement;

            while (ui != null)
            {
                if (ui.IsVisible && ui.Focusable)
                {
                    return(ui);
                }

                ui = VisualTreeHelper.GetAncestor <UIElement>(ui);
            }

            return(null);
        }