public partial class MainView : Window { public MainView() { InitializeComponent(); DataContext = new MainViewModel(); MouseDown += MouseClickHandler; } private void MouseClickHandler(object sender, MouseButtonEventArgs e) { //DoSomething } }
public class MainViewModel { public MainViewModel() { MouseButtonEventHandler mouseButton = MouseClickHandler; } private void MouseClickHandler(object sender, MouseButtonEventArgs e) { //DoSomething } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)