private void GridViewer_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (IsFileOpen && (Keyboard.Modifiers & ModifierKeys.Control) > 0)
     {
         var p     = Mouse.GetPosition(GridViewer);
         var scale = _bitmap.Width / GridViewer.ActualWidth;
         p.X *= scale;
         p.Y *= scale;
         GridViewer.SelectTileAt((int)p.X, (int)p.Y);
         GridViewer.UpdateGrid();
     }
 }
        private void MoveGrid_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var moveGridCommand = e.Command as MoveGridCommand;

            if (moveGridCommand != null)
            {
                GridViewer.OffsetX += moveGridCommand.X;
                GridViewer.OffsetY += moveGridCommand.Y;
            }
            var resetGridCommand = e.Command as ResetGridCommand;

            if (resetGridCommand != null)
            {
                GridViewer.OffsetX = 0;
                GridViewer.OffsetY = 0;
                GridViewer.ClearSelection();
            }
            GridViewer.UpdateGrid();
        }