static FormElementHost() { //Reflect out the KeyboardNavigation singleton and some methods KeyboardNavigation = (KeyboardNavigation)typeof(System.Windows.FrameworkElement).GetProperty("KeyboardNavigation", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null, null); _GetNextTab = KeyboardNavigation.GetType().GetMethod("GetNextTab", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); _GetPrevTab = KeyboardNavigation.GetType().GetMethod("GetPrevTab", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); _GetGroupParent = KeyboardNavigation.GetType().GetMethod("GetGroupParent", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, new Type[] { typeof(System.Windows.DependencyObject), typeof(bool) }, null); }
internal FrameworkServices() { // STA Requirement are checked in InputManager cctor where InputManager.Current is used in KeyboardNavigation cctor _keyboardNavigation = new KeyboardNavigation(); _popupControlService = new PopupControlService(); }
internal FrameworkServices() { this._keyboardNavigation = new KeyboardNavigation(); this._popupControlService = new PopupControlService(); }
private static bool IsStop(UIElement element) { return(KeyboardNavigation.GetIsTabStop(element) && element.IsVisible && element.IsEnabled && element.Focusable); }
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 }
public Stop(Visual element) : this(element, KeyboardNavigation.GetTabIndex(element)) { // }
public void Show() { if (presentationSource != null) { return; } if (Application.Current.MainWindow == null) { Application.Current.MainWindow = this; } presentationSource = ApplicationHost.Current.PresentationSourceFactory.CreatePresentationSource(this); presentationSource.Title = this.Title; keyboardNavigation = new KeyboardNavigation(presentationSource); }