This project is read-only.

NullReference exception in DropDownButton.cs

Oct 11, 2010 at 9:29 AM

After I've changed focus to the BrowserControl on my main window display, when I click on a ribbon dropdown button it crashes:


protected override void OnPreviewMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e)
    if (buttonBorder.IsMouseOver)
        if (!IsDropDownOpen)
            IsDropDownOpen = true;
        else PopupService.RaiseDismissPopupEvent(this, DismissPopupMode.MouseNotOver);
                //Keyboard.Focus(FocusManager.GetFocusScope(ItemContainerGenerator.ContainerFromIndex(0) as FrameworkElement) as IInputElement);
        focusedElement = Keyboard.FocusedElement;
        focusedElement.LostKeyboardFocus += OnFocusedElementLostKeyboardFocus;
        focusedElement.PreviewKeyDown += OnFocusedElementPreviewKeyDown;
        e.Handled = true;

Keyboard.FocusedElement is the offending item.

Oct 13, 2010 at 9:14 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Oct 13, 2010 at 2:07 PM

Confirmed fixed. Thanks.