2
votes

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.

1

1 Answers

1
votes

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();
}