My Viewmodel has an event
public class TestViewModel
{
public event RoutedEventHandler Run;
}
I wanna trigger this event when user clicked on a button in view
How to bind this with a button in a view ?
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.
Routed events are meant for controls not view models, if you have something that should be executed upon a button click a command would be more suitable in my opinion, it can easily be bound to the
Button.Command.