private void OnMapElementPointerExited(MapControl sender, MapElementPointerExitedEventArgs args) { if (args.MapElement is MapIcon mapIcon && args.MapElement.Tag is Canteen c) { mapIcon.Image = GetImageForCanteen(c.Id); } }
private void DigiTransitMapControl_MapElementPointerExited(MapControl sender, MapElementPointerExitedEventArgs args) { MapIcon icon = args.MapElement as MapIcon; if (icon == null) { return; } if ((MapIconState)icon.GetValue(MapIconStateProperty) == MapIconState.PointerOver) { // The MapIconChanged callback in the Attached Property handles Image changing on State changes. See MapElementExtensions.cs. icon.SetValue(MapIconStateProperty, MapIconState.None); } }
Point IMapElementPointerExitedEventArgsResolver.Position(MapElementPointerExitedEventArgs e) => e.Position;
Geopoint IMapElementPointerExitedEventArgsResolver.Location(MapElementPointerExitedEventArgs e) => e.Location;
MapElement IMapElementPointerExitedEventArgsResolver.MapElement(MapElementPointerExitedEventArgs e) => e.MapElement;
/// <summary> /// Gets the physical position on the <see cref="MapControl"/> where it received user input. /// </summary> /// <param name="e">The requested <see cref="MapElementPointerExitedEventArgs"/>.</param> /// <returns> /// The physical position on the <see cref="MapControl"/> where it received user input, /// in terms of X and Y coordinates. /// </returns> public static Point Position(this MapElementPointerExitedEventArgs e) => Resolver.Position(e);
/// <summary> /// Gets the map element that correspond to where the <see cref="MapControl"/> received user input. /// </summary> /// <param name="e">The requested <see cref="MapElementPointerExitedEventArgs"/>.</param> /// <returns>The map element that correspond to where the <see cref="MapControl"/> received user input.</returns> public static MapElement MapElement(this MapElementPointerExitedEventArgs e) => Resolver.MapElement(e);
/// <summary> /// Gets the geographic location that corresponds to where the <see cref="MapControl"/> received user input. /// </summary> /// <param name="e">The requested <see cref="MapElementPointerExitedEventArgs"/>.</param> /// <returns>The geographic location that corresponds to where the <see cref="MapControl"/> received user input.</returns> public static Geopoint Location(this MapElementPointerExitedEventArgs e) => Resolver.Location(e);
private void MainMap_MapElementPointerExited(MapControl sender, MapElementPointerExitedEventArgs args) { AddIns.FirstOrDefault(addin => addin.MapElementsShown.Contains(args.MapElement))?.OnMapElementPointerExited(args.MapElement, args.Location.ToLatLon(), args.Position); }