Note that there are some explanatory texts on larger screens.

plurals
  1. POc# InvalidEnumArgumentException: The value of argument 'direction' (3) is invalid for Enum type 'FocusNavigationDirection'
    primarykey
    data
    text
    <p>I have a WPF-C# application with a ribbon menu and several text box into the main panel. when i focus one of them and press the left arrow, i get the following error. when i press on any other arrow it works well. i tried to breakpoint on a previewKeyDoyn of a specific textbox method but the Exception is thrown before i can ran into it.</p> <p>All other textbox in my application work well when i press the left arrow.</p> <pre><code>System.ComponentModel.InvalidEnumArgumentException: La valeur de l'argument 'direction' (3) n'est pas valide pour le type Enum 'FocusNavigationDirection'. Nom du paramètre : direction à System.Windows.Input.KeyboardNavigation.IsInDirection(Rect fromRect, Rect toRect, FocusNavigationDirection direction) à System.Windows.Input.KeyboardNavigation.FindNextInDirection(DependencyObject sourceElement, Rect sourceRect, DependencyObject container, FocusNavigationDirection direction, Double startRange, Double endRange) à System.Windows.Input.KeyboardNavigation.MoveNext(DependencyObject sourceElement, DependencyObject container, FocusNavigationDirection direction, Double startRange, Double endRange) à System.Windows.Input.KeyboardNavigation.GetNextInDirection(DependencyObject sourceElement, FocusNavigationDirection direction) à System.Windows.Input.KeyboardNavigation.PredictFocusedElement(DependencyObject sourceElement, FocusNavigationDirection direction) à System.Windows.FrameworkElement.PredictFocus(FocusNavigationDirection direction) à Microsoft.Windows.Controls.Ribbon.RibbonHelper.PredictFocus(DependencyObject element, FocusNavigationDirection direction) dans e:\dd\WPFOOB\src\wpfoob\Ribbon\RibbonControlsLibrary\Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs:ligne 488 à Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenu.OnPreviewKeyDown(KeyEventArgs e) dans e:\dd\WPFOOB\src\wpfoob\Ribbon\RibbonControlsLibrary\Microsoft\Windows\Controls\Ribbon\RibbonApplicationMenu.cs:ligne 520 à System.Windows.UIElement.OnPreviewKeyDownThunk(Object sender, KeyEventArgs e) à System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) à System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) à System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) à System.Windows.Input.InputManager.ProcessStagingArea() à System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) à System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) à System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey) à System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG&amp; msg, Boolean&amp; handled) à System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG&amp; msg, ModifierKeys modifiers) à System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param) à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. CONot sure if this helps but "Last" is 3. It's documented as: Last Move focus to the last focusable element in tab order. Not supported for PredictFocus. So, `Last` shouldn't be getting passed to `System.Windows.FrameworkElement.PredictFocus` in your stack. (I notice the previous frame has debug info: `à Microsoft.Windows.Controls.Ribbon.RibbonHelper.PredictFocus(DependencyObject element, FocusNavigationDirection direction) dans e:\dd\WPFOOB\src\wpfoob\Ribbon\RibbonControlsLibrary\Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs:ligne 488`) Maybe you can breakpoint there?
      singulars
      1. This table or related slice is empty.
    2. COFailing that, did you try over-riding: `RibbonApplicationMenu.OnPreviewKeyDown()` in your Ribbon class? That should let you sneak in before the exception is thrown (whereas event handler may not be early enough).
      singulars
      1. This table or related slice is empty.
    3. COI downloaded RibbonControlsLibrary.dll from the official microsoft site: http://www.microsoft.com/en-us/download/confirmation.aspx?id=11877. i can't breakpoint in this dll from VS 2010. i have the most recent version of this dll (4.0.0.11019). Is there an error in this dll ?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload