From: Joe Manke Date: Wed, 14 Aug 2019 00:41:11 +0000 (-0500) Subject: Add separate MarkerClick and InfoWindowClick events for Pins (#6079) X-Git-Tag: accepted/tizen/5.5/unified/20200421.150457~258 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f997a6bcbd1f80283e717143fa44b8fa5f72794;p=platform%2Fcore%2Fcsapi%2Fxsf.git Add separate MarkerClick and InfoWindowClick events for Pins (#6079) * Add separate MarkerClick and InfoWindowClick events for Pins * Mark Pin.Clicked obsolete * Use for loops to look up Pins in renderers. * Add custom EventArgs for MapClicked and InfoWindowClicked * Update MapGalleryPage for new events * Obsolete messages and other cleanup * Correct the pragma when calling Pin.SendTapped * Change obsolete message to say 4.2.0 * Ignore warning on Pin.SendTap() on other platforms * Update obsolete messages to 4.3.0 Co-Authored-By: Samantha Houts fixes #2509 fixes #3131 fixes #5490 --- diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29017.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29017.cs index 83a6436..bcbeccf 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29017.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29017.cs @@ -31,9 +31,10 @@ namespace Xamarin.Forms.Controls.Issues new Button { Text = "Add pins", Command = new Command (() => { - foreach (var pin in map.Pins) { +#pragma warning disable CS0618 pin.Clicked -= PinClicked; +#pragma warning restore CS0618 } map.Pins.Clear (); @@ -54,8 +55,9 @@ namespace Xamarin.Forms.Controls.Issues Type = PinType.Place, Position = new Position (map.VisibleRegion.Center.Latitude + lat, map.VisibleRegion.Center.Longitude + lng) }; - +#pragma warning disable CS0618 pin.Clicked += PinClicked; +#pragma warning restore CS0618 map.Pins.Add (pin); } }) diff --git a/Xamarin.Forms.Controls/GalleryPages/MapGallery.xaml b/Xamarin.Forms.Controls/GalleryPages/MapGallery.xaml index 8ab68a9..e1b8539 100644 --- a/Xamarin.Forms.Controls/GalleryPages/MapGallery.xaml +++ b/Xamarin.Forms.Controls/GalleryPages/MapGallery.xaml @@ -10,6 +10,7 @@ + @@ -17,11 +18,16 @@ Placeholder="Search Address" SearchButtonPressed="SearchForAddress" /> -