private void Enemy_Grid_MouseDown(object sender, MouseButtonEventArgs e) { //Point is a object that holds a x and y value. //Point is then set to the current position of the click origin in //the current window. Point point = Mouse.GetPosition(Application.Current.MainWindow); //Apply the algorith covered in grid to the stored points if (gameBoard.SelectSquare(point, gameBoard.playerTwo.playerGrid)) { Fire_Missile.IsEnabled = true; Rectangle selection = new Rectangle(); selection.Name = "selection"; var sele = (UIElement)LogicalTreeHelper.FindLogicalNode(Enemy_Canvas, "selection"); Enemy_Canvas.Children.Remove(sele); selection.Width = 40; selection.Height = 40; selection.Fill = new SolidColorBrush(Colors.Violet); selection.Opacity = .7; Enemy_Canvas.Children.Add(selection); Canvas.SetTop(selection, (gameBoard.fireLocation.Y * 40)); Canvas.SetLeft(selection, (gameBoard.fireLocation.X * 40)); } }