Example #1
0
 private void OnMapElementPointerEntered(MapControl sender, MapElementPointerEnteredEventArgs args)
 {
     if (args.MapElement is MapIcon mapIcon && args.MapElement.Tag is Canteen c)
     {
         mapIcon.Image = GetInvertedImageForCanteen(c.Id);
     }
 }
Example #2
0
        private void DigiTransitMapControl_MapElementPointerEntered(MapControl sender, MapElementPointerEnteredEventArgs args)
        {
            MapIcon icon = args.MapElement as MapIcon;

            if (icon == null)
            {
                return;
            }

            if ((MapIconState)icon.GetValue(MapIconStateProperty) == MapIconState.None)
            {
                // The MapIconChanged callback in the Attached Property handles Image changing on State changes. See MapElementExtensions.cs.
                icon.SetValue(MapIconStateProperty, MapIconState.PointerOver);
            }
        }
Example #3
0
 Point IMapElementPointerEnteredEventArgsResolver.Position(MapElementPointerEnteredEventArgs e) => e.Position;
Example #4
0
 Geopoint IMapElementPointerEnteredEventArgsResolver.Location(MapElementPointerEnteredEventArgs e) => e.Location;
Example #5
0
 MapElement IMapElementPointerEnteredEventArgsResolver.MapElement(MapElementPointerEnteredEventArgs e) => e.MapElement;
Example #6
0
 /// <summary>
 /// Gets the physical position on the <see cref="MapControl"/> where it received user input.
 /// </summary>
 /// <param name="e">The requested <see cref="MapElementPointerEnteredEventArgs"/>.</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 MapElementPointerEnteredEventArgs e) => Resolver.Position(e);
Example #7
0
 /// <summary>
 /// Gets the map element that correspond to where the <see cref="MapControl"/> received user input.
 /// </summary>
 /// <param name="e">The requested <see cref="MapElementPointerEnteredEventArgs"/>.</param>
 /// <returns>The map element that correspond to where the <see cref="MapControl"/> received user input.</returns>
 public static MapElement MapElement(this MapElementPointerEnteredEventArgs e) => Resolver.MapElement(e);
Example #8
0
 /// <summary>
 /// Gets the geographic location that corresponds to where the <see cref="MapControl"/> received user input.
 /// </summary>
 /// <param name="e">The requested <see cref="MapElementPointerEnteredEventArgs"/>.</param>
 /// <returns>The geographic location that corresponds to where the <see cref="MapControl"/> received user input.</returns>
 public static Geopoint Location(this MapElementPointerEnteredEventArgs e) => Resolver.Location(e);
 private void MainMap_MapElementPointerEntered(MapControl sender, MapElementPointerEnteredEventArgs args)
 {
     AddIns.FirstOrDefault(addin => addin.MapElementsShown.Contains(args.MapElement))?.OnMapElementPointerEntered(args.MapElement, args.Location.ToLatLon(), args.Position);
 }
 private void MainMap_MapElementPointerEntered(MapControl sender, MapElementPointerEnteredEventArgs args)
 {
     AddIns.FirstOrDefault(addin => addin.MapElementsShown.Contains(args.MapElement))?.OnMapElementPointerEntered(args.MapElement, args.Location.ToLatLon(), args.Position);
 }