/// <summary>
 /// React on left button down. Check click on buttons or start drag otherwise.
 /// </summary>
 /// <param name="sender">Ignored.</param>
 /// <param name="e">Event args.</param>
 private void _PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     // Check close button pressed.
     if (_IsElementPressed(CloseButton, e))
     {
         // Hide hint.
         Visibility = Visibility.Collapsed;
     }
     // Check tool button pressed.
     else if (_IsElementPressed(PushpinToolButton, e))
     {
         // Change tool state.
         _AddressByPointToolPressed();
     }
     // Check link click.
     else if (_IsElementPressed(ZoomedAddress, e))
     {
         // Zoom to candidates.
         MapExtentHelpers.ZoomToCandidates(_mapControl, _candidatesToZoom);
     }
     else
     {
         // Start drag if mouse was clicked on canvas.
         GeocodingHint geocodingHint = XceedVisualTreeHelper.FindParent <GeocodingHint>((DependencyObject)e.Source);
         if (geocodingHint != null || e.Source == this)
         {
             _isDown     = true;
             _startPoint = e.GetPosition(_canvas);
             _canvas.CaptureMouse();
             e.Handled = true;
         }
     }
 }
 /// <summary>
 /// Show hint "Could not located, but zoomed..."
 /// </summary>
 /// <param name="geocodableItem">Geocodable object.</param>
 /// <param name="candidatesToZoom">Address to which map was zoomed. Null if not zoomed.</param>
 public void ShowZoomToCandidatePopup(IGeocodable geocodableItem, AddressCandidate[] candidatesToZoom)
 {
     if (_isGeocodingHintInitialized)
     {
         // Show hint suspendedly because final selection changed event in datagrid control is suspended.
         // And so hint will be hided on selection changed.
         Dispatcher.BeginInvoke(new Action(delegate()
         {
             if (SelectedItems.Count > 0 && SelectedItems[0] == geocodableItem)
             {
                 GeocodingHint.ShowHint(geocodableItem, candidatesToZoom);
             }
         }), DispatcherPriority.Background);
     }
 }
        /// <summary>
        /// Init geocoding hint if map control from geocodable page.
        /// </summary>
        private void _InitGeocodingHint()
        {
            // Find address by point tool.
            AddressByPointTool addressByPointTool = null;

            foreach (IMapTool tool in _tools.Tools)
            {
                if (tool is AddressByPointTool)
                {
                    addressByPointTool = tool as AddressByPointTool;
                    break;
                }
            }

            if (addressByPointTool != null)
            {
                GeocodingHint.Initialize(canvas, this, addressByPointTool);
                _isGeocodingHintInitialized = true;
            }
        }
 /// <summary>
 /// Hide hint "Could not located, but zoomed..."
 /// </summary>
 public void HideZoomToCandidatePopup()
 {
     GeocodingHint.HideHint();
 }