Guest User

Untitled

a guest
Feb 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. using System;
  2. using Xamarin.Forms.Maps;
  3.  
  4. namespace PinClickDemo
  5. {
  6. public class ExtendedMap : Map
  7. {
  8. public event EventHandler<TapEventArgs> Tap;
  9.  
  10. public ExtendedMap()
  11. {
  12.  
  13. }
  14.  
  15. public ExtendedMap(MapSpan region) : base(region)
  16. {
  17.  
  18. }
  19.  
  20. public void OnTap(Position coordinate)
  21. {
  22. OnTap(new TapEventArgs { Position = coordinate });
  23. }
  24.  
  25. protected virtual void OnTap(TapEventArgs e)
  26. {
  27. var handler = Tap;
  28. if (handler != null) handler(this, e);
  29. }
  30. }
  31.  
  32. public class TapEventArgs : EventArgs
  33. {
  34. public Position Position { get; set; }
  35. }
  36. }
Add Comment
Please, Sign In to add comment