Example #1
0
        public static void MarkerMouseClick(object sender, MouseButtonEventArgs e)
        {
            Marker currentMarker = (Marker)sender;

            if (e.ChangedButton == MouseButton.Left)
            {
                ClosablePopup attachedPopup = currentMarker.Tag as ClosablePopup;
                PopupOverlay  popupOverlay  = CurrentOverlays.PopupOverlay;
                if (attachedPopup == null || !popupOverlay.Popups.Contains(attachedPopup))
                {
                    PointShape position = new PointShape(currentMarker.Position.X, currentMarker.Position.Y);
                    attachedPopup                = new ClosablePopup(position);
                    attachedPopup.ParentMap      = GisEditor.ActiveMap;
                    attachedPopup.WorkingContent = GetWorkingContent(position);
                    SetPopupOffset(attachedPopup);
                    popupOverlay.Popups.Add(attachedPopup);

                    GisEditor.ActiveMap.Refresh(popupOverlay);
                    currentMarker.Tag = attachedPopup;
                }

                if (attachedPopup != null && attachedPopup.Visibility == Visibility.Collapsed)
                {
                    attachedPopup.Visibility = Visibility.Visible;
                }
            }
        }
Example #2
0
        private static void SetPopupOffset(ClosablePopup attachedPopup)
        {
            TranslateTransform translate = new TranslateTransform();

            translate.Y = -25;
            attachedPopup.RenderTransform = translate;
        }
Example #3
0
        public static void MarkerPositionChanged(object sender, PositionChangedMarkerEventArgs e)
        {
            Marker currentMarker = (Marker)sender;

            currentMarker.ToolTip = GetWorkingContent(e.NewPosition);

            ClosablePopup attachedPopup = currentMarker.Tag as ClosablePopup;

            if (attachedPopup != null)
            {
                attachedPopup.Position       = new Point(e.NewPosition.X, e.NewPosition.Y);
                attachedPopup.WorkingContent = GetWorkingContent(e.NewPosition);
            }
        }