コード例 #1
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);
            }
        }
コード例 #2
0
        private static void marker_PositionChanged(object sender, PositionChangedMarkerEventArgs e)
        {
            //if (!isPositionChangeStarted && Keyboard.Modifiers == ModifierKeys.Shift)
            if (!isPositionChangeStarted)
            {
                isPositionChangeStarted = true;
                double offsetX = e.NewPosition.X - e.PreviousPosition.X;
                double offsetY = e.NewPosition.Y - e.PreviousPosition.Y;
                foreach (var marker in CurrentMarkerOverlay.Markers.Where(tmpMarker => tmpMarker != sender))
                {
                    marker.Position = new Point(marker.Position.X + offsetX, marker.Position.Y + offsetY);
                }

                isPositionChangeStarted = false;
            }
        }