예제 #1
0
            public override IEnumerable <Stop> GetGlobalStops(Visual scope, Visual currentElement, DependencyProperty navigationModeProperty)
            {
                int scopeTabIndex = KeyboardNavigation.GetTabIndex(scope);

                if (IsStop((UIElement)scope) || scope == currentElement)
                {
                    yield return(new Stop(scope, scopeTabIndex));
                }

                // translate stops to have scope tab index instead of local tab index, local order is kept
                foreach (Stop stop in scope.VisualChildren.SelectMany(child => KeyboardNavigationTarget.GetGlobalStops(child, currentElement, navigationModeProperty)).OrderBy(childStop => childStop.TabIndex))
                {
                    yield return(new Stop(stop.Element, scopeTabIndex));
                }
            }
예제 #2
0
 public override Visual FindPreviousTarget(Visual scope, Stop currentStop, DependencyProperty navigationModeProperty, IStopComparerProvider stopComparerProvider)
 {
     return(KeyboardNavigationTarget.FindPreviousContainedTarget(scope, currentStop, navigationModeProperty, stopComparerProvider) ??
            (scope.VisualParent != null ? KeyboardNavigationTarget.FindPreviousTarget(scope.VisualParent, new Stop(currentStop.Element, KeyboardNavigation.GetTabIndex(scope)), navigationModeProperty, stopComparerProvider) : null)); // translate currentStop and forward request to parent
 }
예제 #3
0
 public Stop(Visual element) :
     this(element, KeyboardNavigation.GetTabIndex(element))
 {
     //
 }