Use the IsFocused Attached Property as suggested in the Answer here: Set focus on textbox in WPF from view model (C#)
Then you can simply bind to a property in your viewmodel.
Use the IsFocused Attached Property as suggested in the Answer here: Set focus on textbox in WPF from view model (C#)
Then you can simply bind to a property in your viewmodel.