protected override void OnPointerPressed(PointerRoutedEventArgs e) { base.OnPointerPressed(e); if (this.IsDraggable) { if (this.map != null) { // Store the map's center position this.center = this.map.Center; // Store the map's previous interaction modes this.previousPanMode = this.map.PanInteractionMode; this.previousRotateMode = this.map.RotateInteractionMode; this.previousTiltMode = this.map.TiltInteractionMode; this.previousZoomMode = this.map.ZoomInteractionMode; // Turn off any map interaction modes while we move the pin this.map.PanInteractionMode = MapPanInteractionMode.Disabled; this.map.RotateInteractionMode = MapInteractionMode.Disabled; this.map.TiltInteractionMode = MapInteractionMode.Disabled; this.map.ZoomInteractionMode = MapInteractionMode.Disabled; // Attach events to the map to track manipulation events this.map.ActualCameraChanged += this.OnMapCameraChanged; this.map.ActualCameraChanging += this.OnMapCameraChanging; this.map.PointerReleased += this.OnMapPointerReleased; this.map.PointerMoved += this.OnMapPointerMoved; this.map.PointerExited += this.OnMapPointerReleased; } var pointerPosition = e.GetCurrentPoint(this.map); Geopoint location = null; if (this.map != null) { this.map.GetLocationFromOffset(pointerPosition.Position, out location); MapControl.SetLocation(this, location); } this.DragStarted?.Invoke(location); this.isDragging = true; } }
public static void SetRotationControlsVisible(MapInteractionMode Value) { ApplicationData.Current.LocalSettings.Values["RotationControlsVisible2"] = Value.ToString(); }
public static int EnumToIndexConverter(MapInteractionMode Entry) { return(MapInteractionModeOptionsstatic.FindIndex(x => x == Entry.ToString())); }
protected override void OnCurrentDynamicInteractionModeChanged(MapInteractionMode mode) { DynamicInteractionModeDescription = (mode != null) ? mode.DescriptionResourceKey : null; }