private void Cell_LeftClick(object sender, RoutedEventArgs e) { if (my_turn) { Rectangle cell = (Rectangle)sender; var coordinates = cell.Name.Remove(0, 6); int x = int.Parse(coordinates) % 10; int y = int.Parse(coordinates) / 10; if (field[x + y * 10]) { return; } my_turn = false; Greetings.Content = "Nombre del Rival: " + opponent_name + "; Turno: " + opponent_name; main.DoTurn(x, y); } }