Application crash - Bug ?

Docking/MDI for WPF Forum

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was before this thread was created.
Posted 12 days ago by Martin de Jong - Statistics Netherlands
Version: 18.1.0673


In some (rare) occasions an exception inside windows or actipro is thrown.  It looks like a popup menu closing caused this. The underlying sample i can reproduce doing (clicking on an button in a contextmenu, function breaking in debugger, continue code). Throwing occurs after fully executing command and closing context menu, maybe in querying CanExecutes? But other situation, like typing inside syntax editor can cause this error too, maybe related to the tooltips/intellisense in this case. Can you have a look?

Value cannot be null.
Parameter name: menuSite

at System.Windows.Input.InputManager.PushMenuMode(PresentationSource menuSite)
at System.Windows.Controls.Primitives.MenuBase.OnPreviewKeyboardInputProviderAcquireFocus(Object sender, KeyboardInputProviderAcquireFocusEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Windows.UIElement.Focus()
at ActiproSoftware.Windows.Controls.Ribbon.UI.PopupControlService.<>c__DisplayClass76_0.<OpenPopup>b__0(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler

Comments (2)

Posted 11 days ago by Actipro Software Support - Cleveland, OH, USA

Hi Martin,

In our internal PopupControlService.OpenPopup method, we do have a dispatched call to focus the first control in the popup.  This allows the popup's first focusable child control to have focus after display.  I believe that is the logic for our "PopupControlService" in your stack trace above.  The BeginInvoke is kicked off with DispatcherPriority.Background priority.

We are going to make a code update to check within that BeginInvoke'd logic to check whether the popup is still open before it tries to do the Focus() call.  I'm hopeful that will help, since perhaps you might be closing the popup before that BeginInvoke'd code executes.  If you'd like to test a preview build with that code update, please write our support address and mention this thread.

Actipro Software Support

Posted 7 days ago by Martin de Jong - Statistics Netherlands


I think we wait till the release. In the meantime i'll try to find more situations (without debugger attached).

Add Comment

Please log in to a validated account to post comments.