/// <summary>
        /// Handle the mouse left button up event.  Here we actually process the selected rectangle
        /// if any by first raising an event for client to receive then also zooming to that rectangle
        /// if ZoomSelection is true
        /// </summary>
        /// <param name="sender">Mouse</param>
        /// <param name="e">Mouse button information</param>
        void OnMouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
        {
            _watching = false;
            if (_selectionRectVisual != null)
            {
                Mouse.Capture(_target, CaptureMode.None);
                Point  pos = e.GetPosition(_container);
                Double f   = Math.Min(Math.Abs(pos.X - _mouseDownPoint.X), Math.Abs(pos.Y - _mouseDownPoint.Y));
                Rect   r   = GetSelectionRect(pos);
                SelectionRectangle = r;

                Selected?.Invoke(this, EventArgs.Empty);

                if (ZoomSelection && f > ZoomSizeThreshold)
                {
                    _zoom.ZoomToRect(r);
                }

                _container.Children.Remove(_selectionRectVisual);
                _selectionRectVisual = null;
            }
            else
            {
                if (e.GetPosition(_container) == _start)
                {
                    ZoomReset?.Invoke(this, EventArgs.Empty);
                }
            }
        }
 /// <summary>
 /// Handle Mouse Move event.  Here we detect whether we've exceeded the _selectionThreshold
 /// and if so capture the mouse and create the visual zoom rectangle on the container object.
 /// </summary>
 /// <param name="sender">Mouse</param>
 /// <param name="e">Mouse move information.</param>
 void OnMouseMove(Object sender, MouseEventArgs e)
 {
     if (_watching)
     {
         Point pos = e.GetPosition(_container);
         if (new Vector(_start.X - pos.X, _start.Y - pos.Y).Length > _selectionThreshold)
         {
             _watching = false;
             Mouse.Capture(_target, CaptureMode.SubTree);
             _selectionRectVisual = new MesSelectionRectVisual(_start, _start, _zoom.Value);
             _container.Children.Add(_selectionRectVisual);
         }
     }
     if (_selectionRectVisual != null)
     {
         if (_selectionRectVisual.Zoom != _zoom.Value)
         {
             _selectionRectVisual.Zoom = _zoom.Value;
         }
         _selectionRectVisual.SecondPoint = e.GetPosition(_container);
     }
 }