void OnImageHandlerScroolViewerScrollChanged(object sender, ScrollChangedEventArgs e)
        {
            if (e.ExtentHeightChange != 0 || e.ExtentWidthChange != 0)
            {
                Point?targetBefore = null;
                Point?targetNow    = null;

                if (!lastMousePositionOnTarget.HasValue)
                {
                    if (lastCenterPositionOnTarget.HasValue)
                    {
                        var centerOfViewport = new Point(ImageHandlerScroolViewer.ViewportWidth / 2,
                                                         ImageHandlerScroolViewer.ViewportHeight / 2);
                        Point centerOfTargetNow =
                            ImageHandlerScroolViewer.TranslatePoint(centerOfViewport, ImageHandler);

                        targetBefore = lastCenterPositionOnTarget;
                        targetNow    = centerOfTargetNow;
                    }
                }
                else
                {
                    targetBefore = lastMousePositionOnTarget;
                    targetNow    = Mouse.GetPosition(ImageHandler);

                    lastMousePositionOnTarget = null;
                }

                if (targetBefore.HasValue)
                {
                    double dXInTargetPixels = targetNow.Value.X - targetBefore.Value.X;
                    double dYInTargetPixels = targetNow.Value.Y - targetBefore.Value.Y;

                    double multiplicatorX = e.ExtentWidth / ImageHandler.Width;
                    double multiplicatorY = e.ExtentHeight / ImageHandler.Height;

                    double newOffsetX = ImageHandlerScroolViewer.HorizontalOffset -
                                        dXInTargetPixels * multiplicatorX;
                    double newOffsetY = ImageHandlerScroolViewer.VerticalOffset -
                                        dYInTargetPixels * multiplicatorY;

                    if (double.IsNaN(newOffsetX) || double.IsNaN(newOffsetY))
                    {
                        return;
                    }

                    ImageHandlerScroolViewer.ScrollToHorizontalOffset(newOffsetX);
                    ImageHandlerScroolViewer.ScrollToVerticalOffset(newOffsetY);
                }
            }
        }
        }   //skończone

        #endregion

        #region Image Handler Events

        /// <summary>
        /// When user interact with image
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        void OnMouseMove(object sender, MouseEventArgs e)
        {
            if (lastDragPoint.HasValue)
            {
                Point posNow = e.GetPosition(ImageHandlerScroolViewer);

                double dX = posNow.X - lastDragPoint.Value.X;
                double dY = posNow.Y - lastDragPoint.Value.Y;

                lastDragPoint = posNow;

                ImageHandlerScroolViewer.ScrollToHorizontalOffset(ImageHandlerScroolViewer.HorizontalOffset - dX);
                ImageHandlerScroolViewer.ScrollToVerticalOffset(ImageHandlerScroolViewer.VerticalOffset - dY);
            }
        }