Example #1
0
        private void Grid_MouseUp_Left(object sender, MouseButtonEventArgs a)
        {
            // Release the mouse capture
            TheOtherGrid.ReleaseMouseCapture();

            // Hide the drag selection box.
            selectionBox_Left.Visibility = Visibility.Collapsed;

            Point mouseUpPos_Left = a.GetPosition(TheOtherGrid);
        }
Example #2
0
        private void Grid_MouseDown_Left(object sender, MouseButtonEventArgs a)
        {
            //Check when the Tiles on the Left have been clicked
            mouseDownPos_Left = a.GetPosition(TheOtherGrid);
            TheOtherGrid.CaptureMouse();

            Deselect_All();

            foreach (Rect rects3 in tileRects2)
            {
                if (rects3.Contains(mouseDownPos_Left))
                {
                    tileList2[tileRects2.IndexOf(rects3)].SelectTile2();
                    SelectedTile     = tileList2[tileRects2.IndexOf(rects3)].CopyTile();
                    SelectedTileName = tileList2[tileRects2.IndexOf(rects3)].getImageName();
                }
                else
                {
                    tileList2[tileRects2.IndexOf(rects3)].DeselectTile();
                }
            }
        }