private void Undo_Button_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; OthelloView v = btn.DataContext as OthelloView; OthelloViewModel vm = v.FindResource("vm") as OthelloViewModel; vm.UndoLastMove(); }
private void UndoButton_Click(object sender, RoutedEventArgs e) { var viewModel = OthelloView.FindResource("vm") as OthelloViewModel; viewModel.UndoLastMove(); }