summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Maps
diff options
context:
space:
mode:
authorjcmanke <jmanke1227@gmail.com>2017-04-11 22:52:04 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-04-11 22:52:04 (GMT)
commitdfda41b0bdc0ea80f548e3c919f14e8094c6cb25 (patch)
tree32dbdc4a31899c3c5e31329ad9d86bca21c4e235 /Xamarin.Forms.Maps
parentb832b67875789f2fccea5077c86238e75cf373ff (diff)
downloadxamarin-forms-dfda41b0bdc0ea80f548e3c919f14e8094c6cb25.zip
xamarin-forms-dfda41b0bdc0ea80f548e3c919f14e8094c6cb25.tar.gz
xamarin-forms-dfda41b0bdc0ea80f548e3c919f14e8094c6cb25.tar.bz2
Map renderer extensibility (#844)
* Added extensibility features to Maps Android MapRenderer: - Moved map initialization to protected virtual method OnMapReady, called by explicit implementation of IOnMapReady - Added protected virtual method CreateMarker for customization of pins iOS MapRenderer: - Added protected virtual method CreateAnnotation for customization of pins Pin: - Unsealed the Pin class - Made Label a bindable property * [Docs] Update docs
Diffstat (limited to 'Xamarin.Forms.Maps')
-rw-r--r--Xamarin.Forms.Maps/Pin.cs19
1 files changed, 6 insertions, 13 deletions
diff --git a/Xamarin.Forms.Maps/Pin.cs b/Xamarin.Forms.Maps/Pin.cs
index 6c0fb55..912c30e 100644
--- a/Xamarin.Forms.Maps/Pin.cs
+++ b/Xamarin.Forms.Maps/Pin.cs
@@ -2,7 +2,7 @@
namespace Xamarin.Forms.Maps
{
- public sealed class Pin : BindableObject
+ public class Pin : BindableObject
{
public static readonly BindableProperty TypeProperty = BindableProperty.Create("Type", typeof(PinType), typeof(Pin), default(PinType));
@@ -10,9 +10,7 @@ namespace Xamarin.Forms.Maps
public static readonly BindableProperty AddressProperty = BindableProperty.Create("Address", typeof(string), typeof(Pin), default(string));
- // introduced to store the unique id for Android markers
-
- string _label;
+ public static readonly BindableProperty LabelProperty = BindableProperty.Create("Label", typeof(string), typeof(Pin), default(string));
public string Address
{
@@ -22,14 +20,8 @@ namespace Xamarin.Forms.Maps
public string Label
{
- get { return _label; }
- set
- {
- if (_label == value)
- return;
- _label = value;
- OnPropertyChanged();
- }
+ get { return (string)GetValue(LabelProperty); }
+ set { SetValue(LabelProperty, value); }
}
public Position Position
@@ -44,6 +36,7 @@ namespace Xamarin.Forms.Maps
set { SetValue(TypeProperty, value); }
}
+ // introduced to store the unique id for Android markers
internal object Id { get; set; }
public event EventHandler Clicked;
@@ -96,4 +89,4 @@ namespace Xamarin.Forms.Maps
return string.Equals(Label, other.Label) && Equals(Position, other.Position) && Type == other.Type && string.Equals(Address, other.Address);
}
}
-} \ No newline at end of file
+}