Share via


Pin Class

Definition

A marker on a Map.

public class Pin : Xamarin.Forms.Element
type Pin = class
    inherit Element
Inheritance
System.Object
Pin

Remarks

A Pin must have its Label property assigned before it is added to a map. If not, a System.ArgumentException is thrown.

public static Page GetMapPage ()
{	
	var map = new Map (MapSpan.FromCenterAndRadius (new Position (37, -122), Distance.FromMiles (10)));

//If Label is not set, runtime exception
	var pin = new Pin () {
		Position = new Position (37, -122),
		Label = "Some Pin!"
	};
	map.Pins.Add (pin);

	var cp = new ContentPage { 
		Content = map, 
	};

	return cp;
}

Constructors

Pin()

Creates a new Pin object with default values.

Fields

AddressProperty

Identifies the Address bindable property.

LabelProperty

Backing store for the Label property.

PositionProperty

Identifies the Position bindable property.

TypeProperty

Identifies the PinType bindable property.

Properties

Address

A describing the street address.

AutomationId

Gets or sets a value that allows the automation framework to find and interact with this element.

(Inherited from Element)
BindingContext

Gets or sets object that contains the properties that will be targeted by the bound properties that belong to this BindableObject.

(Inherited from BindableObject)
ClassId

Gets or sets a value used to identify a collection of semantically similar elements.

(Inherited from Element)
Dispatcher (Inherited from BindableObject)
EffectControlProvider

For internal use by the Xamarin.Forms platform.

(Inherited from Element)
Effects

A list of the effects that are applied to this item.

(Inherited from Element)
Id
Obsolete.

For internal use by the Xamarin.Forms platform.

Label

A user-readable associated with the Pin.

LogicalChildren

For internal use by the Xamarin.Forms platform.

(Inherited from Element)
MarkerId

For internal use by the Xamarin.Forms platform.

Parent

Gets or sets the parent element of the element.

(Inherited from Element)
ParentView
Obsolete.

Gets the element which is the closest ancestor of this element that is a VisualElement.

(Inherited from Element)
Platform
Obsolete.
(Inherited from Element)
Position

The latitude and longitude of the Pin.

RealParent

For internal use by the Xamarin.Forms platform.

(Inherited from Element)
StyleId

Gets or sets a user defined value to uniquely identify the element.

(Inherited from Element)
Type

The kind of pin.

Methods

ApplyBindings()

Apply the bindings to BindingContext.

(Inherited from BindableObject)
ClearValue(BindableProperty)

Clears any value set by SetValue for property.

(Inherited from BindableObject)
ClearValue(BindablePropertyKey)

Clears any value set by SetValue for the property that is identified by propertyKey.

(Inherited from BindableObject)
CoerceValue(BindableProperty) (Inherited from BindableObject)
CoerceValue(BindablePropertyKey) (Inherited from BindableObject)
Descendants()

For internal use by the Xamarin.Forms platform.

(Inherited from Element)
EffectIsAttached(String)

For internal use by the Xamarin.Forms platform.

(Inherited from Element)
Equals(Object)

Whether obj with equivalent Type, Position, Label and Address.

FindByName(String)

Returns the element that has the specified name.

(Inherited from Element)
GetHashCode()

The hash value for the Pin

GetValue(BindableProperty)

Returns the value that is contained in the BindableProperty.

(Inherited from BindableObject)
GetValues(BindableProperty, BindableProperty, BindableProperty)
Obsolete.

For internal use by the Xamarin.Forms platform.

(Inherited from BindableObject)
GetValues(BindableProperty, BindableProperty)
Obsolete.

For internal use by the Xamarin.Forms platform.

(Inherited from BindableObject)
IsSet(BindableProperty)

Returns true if the target property exists and has been set.

(Inherited from BindableObject)
OnBindingContextChanged()

Invoked whenever the binding context of the element changes. Implement this method to add class handling for this event.

(Inherited from Element)
OnChildAdded(Element)

Invoked whenever the ChildAdded event needs to be emitted. Implement this method to add class handling for this event.

(Inherited from Element)
OnChildRemoved(Element, Int32) (Inherited from Element)
OnChildRemoved(Element)
Obsolete.

Invoked whenever the ChildRemoved event needs to be emitted. Implement this method to add class handling for this event.

(Inherited from Element)
OnParentSet()

Invoked whenever the Parent of an element is set. Implement this method in order to add behavior when the element is added to a parent.

(Inherited from Element)
OnPropertyChanged(String)

Method that is called when a bound property is changed.

(Inherited from Element)
OnPropertyChanging(String)

Call this method from a child class to notify that a change is going to happen on a property.

(Inherited from BindableObject)
RemoveBinding(BindableProperty)

Removes a previously set binding.

(Inherited from BindableObject)
RemoveDynamicResource(BindableProperty)

Removes a previously set dynamic resource

(Inherited from Element)
SendInfoWindowClick()
SendMarkerClick()
SendTap()
Obsolete.

For internal use by the Xamarin.Forms platform.

SetBinding(BindableProperty, BindingBase)

Assigns a binding to a property.

(Inherited from BindableObject)
SetDynamicResource(BindableProperty, String)

Sets the BindableProperty property of this element to be updated via the DynamicResource with the provided key.

(Inherited from Element)
SetValue(BindableProperty, Object)

Sets the value of the specified property.

(Inherited from BindableObject)
SetValue(BindablePropertyKey, Object)

Sets the value of the propertyKey.

(Inherited from BindableObject)
SetValueCore(BindableProperty, Object, SetValueFlags)

For internal use by the Xamarin.Forms platform.

(Inherited from BindableObject)
SetValueFromRenderer(BindableProperty, Object)

For internal use by the Xamarin.Forms platform.

(Inherited from Element)
SetValueFromRenderer(BindablePropertyKey, Object)

For internal use by the Xamarin.Forms platform.

(Inherited from Element)
UnapplyBindings()

Unapplies all previously set bindings.

(Inherited from BindableObject)

Operators

Equality(Pin, Pin)

Whether left and right have equivalent Type, Position, Label and Address values.

Inequality(Pin, Pin)

Whether left and right differ in any of their Type, Position, Label and Address values.

Events

BindingContextChanged

Raised whenever the BindingContext property changes.

(Inherited from BindableObject)
ChildAdded

Occurs whenever a child element is added to the element.

(Inherited from Element)
ChildRemoved

Occurs whenever a child element is removed from the element.

(Inherited from Element)
Clicked
Obsolete.

Event that is raised when the pin is clicked.

DescendantAdded

Occurs whenever a child element is added to the elements subtree.

(Inherited from Element)
DescendantRemoved

Occurs whenever a child element is removed from the elements subtree.

(Inherited from Element)
InfoWindowClicked
MarkerClicked
PlatformSet
Obsolete.
(Inherited from Element)
PropertyChanged

Raised when a property has changed.

(Inherited from BindableObject)
PropertyChanging

Raised when a property is about to change.

(Inherited from BindableObject)

Explicit Interface Implementations

IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

For internal use by the Xamarin.Forms platform.

(Inherited from BindableObject)
IElementController.SetValueFromRenderer(BindableProperty, Object)

For internal use by the Xamarin.Forms platform.

(Inherited from Element)
INameScope.RegisterName(String, Object)

For internal use only.

(Inherited from Element)

Extension Methods

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)
SetAppThemeColor(BindableObject, BindableProperty, Color, Color)
SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)

Creates and applies a binding to a property.

SetBinding<TSource>(BindableObject, BindableProperty, Expression<Func<TSource,Object>>, BindingMode, IValueConverter, String)
Obsolete.

Creates and applies a binding from an expression.

SetOnAppTheme<T>(BindableObject, BindableProperty, T, T)
FindByName<T>(Element, String)

Returns the instance of type T that has name name in the scope that includes element.

Applies to