I want to control focus from my ViewModel. How can I locate the currently focused control in my View, and how can I set focus on another control from my ViewModel?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Giving a control focus really should be done in the code behind, not in the ViewModel. Your ViewModel is specifically used for communicating between your View and you Model. Any UI changes that don’t have to do with you Model can be done in the code behind.