WPF-MVVM: Setting UI control focus from ViewModel

后端 未结 5 978
旧时难觅i
旧时难觅i 2020-12-08 09:14

What is a good practice of setting control focus in MVVM architecture.

The way I envision it, is with a property on the ViewModel that would trigger a focus change

5条回答
  •  無奈伤痛
    2020-12-08 10:00

    The ViewModel throws an event to the View telling it that the action has been completed, and the View will set the focus.

提交回复
热议问题