i want bind RelayCommand to Button Click event
(i know i can bind to command property but i want bind to click event)
how i can do this?
i used this code but not work:
private void Button_Clicked(object sender, RoutedEventArgs e) {
FrameworkElement fe=sender as FrameworkElement;
((FirstViewModel)fe.DataContext).ShowSecondViewCommand();
}
Some of my personal controls do not have this property (command) so i cant bind my commands to command property
Assuming you have the correct xaml to bind a command. The following code will execute the command assigned to the button: