2

I have a problem with the Microsoft Ribbon Control. If I have the focus in a Textbox and click a Button in the Ribbon menu, the focus still remains in the Textbox. And so the textbox property in my ViewModel does not get updated.

I searched the web but did not find a solution. I tried setting FocusManager.IsFocusScope and Focusable of the Ribbon control with no effect.

All I want is if the button is clicked the textbox looses focus.

H.B.
  • 166,899
  • 29
  • 327
  • 400
LuckyStrike
  • 1,483
  • 3
  • 12
  • 23

1 Answers1

1

I'd imagine something like this: (assuming the ribbon's x:name is ribbon)

ribbon.PreviewMouseDown += handlerMethod;
public void handlerMethod(object sender, MouseEventArgs e)
{
    ribbon.Focus();
}
It'sNotALie.
  • 22,289
  • 12
  • 68
  • 103