private void SetMiniMapBorderRange()
        {
            //var scaledMiniMapHeight = BorderMiniMap.ActualHeight * ActualHeight / MapHeight;
            //var scaledMiniMapWidth = BorderMiniMap.ActualWidth * ActualWidth / MapWidth;

            //if (scaledMiniMapHeight > BorderMiniMap.ActualHeight)
            //{
            //  scaledMiniMapHeight = BorderMiniMap.ActualHeight;
            //}

            //if (scaledMiniMapWidth > BorderMiniMap.ActualWidth)
            //{
            //  scaledMiniMapWidth = BorderMiniMap.ActualWidth;
            //}

            ScrollViewerAdjustableSizeMap.UpdateLayout();

            //var verticalOffset = ScrollViewerAdjustableSizeMap.VerticalOffset * BorderMiniMap.ActualHeight / MapHeight;
            //var horizontalOffset = ScrollViewerAdjustableSizeMap.HorizontalOffset * BorderMiniMap.ActualWidth / MapWidth;

            //BorderMiniMapRange.Height = scaledMiniMapHeight;
            //BorderMiniMapRange.Width = scaledMiniMapWidth;

            //Canvas.SetTop(BorderMiniMapRange, verticalOffset);
            //Canvas.SetLeft(BorderMiniMapRange, horizontalOffset);
        }
        private void ScrollViewerAdjustableSizeMapMouseMove(object sender, MouseEventArgs e)
        {
            if (m_LastDragPoint.HasValue)
            {
                var posNow = e.GetPosition(ScrollViewerAdjustableSizeMap);

                var dX = posNow.X - m_LastDragPoint.Value.X;
                var dY = posNow.Y - m_LastDragPoint.Value.Y;

                m_LastDragPoint = posNow;

                ScrollViewerAdjustableSizeMap.ScrollToHorizontalOffset(ScrollViewerAdjustableSizeMap.HorizontalOffset - dX);
                ScrollViewerAdjustableSizeMap.ScrollToVerticalOffset(ScrollViewerAdjustableSizeMap.VerticalOffset - dY);
            }
        }
        private void ScrollViewerAdjustableSizeMapMouseMove(object sender, MouseEventArgs e)
        {
            if (m_LastDragPoint.HasValue)
            {
                var posNow = e.GetPosition(ScrollViewerAdjustableSizeMap);

                var dX = posNow.X - m_LastDragPoint.Value.X;
                var dY = posNow.Y - m_LastDragPoint.Value.Y;

                m_LastDragPoint = posNow;

                ScrollViewerAdjustableSizeMap.ScrollToHorizontalOffset(ScrollViewerAdjustableSizeMap.HorizontalOffset - dX);
                ScrollViewerAdjustableSizeMap.ScrollToVerticalOffset(ScrollViewerAdjustableSizeMap.VerticalOffset - dY);

                if (e.LeftButton == MouseButtonState.Pressed)
                {
                    SetMiniMapBorderRange();
                }
            }
        }
 private void ScrollViewerAdjustableSizeMapPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     ScrollViewerAdjustableSizeMap.Cursor = Cursors.Arrow;
     ScrollViewerAdjustableSizeMap.ReleaseMouseCapture();
     m_LastDragPoint = null;
 }