Is there any particular way to implement command in MVVM if the element doesn’t support Command. Example how to implement the TextChanged_event for the TextBox?.
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.
There is no need to use the TextChanged_event or the SelectionchangedEvent as you can achieve the same using binding them to your ViewModel properties and waiting for their notification message (check MVVMLight’s Messenger helper class).
If you desperately need a handler for those events, you can try the EventToCommand behaviour helper class which uses RelayCommand
You can check out this illustration and example program for details on messenger class and this example for getting a clear picture on EventToCommand behaviour