Pin 類別

定義

Map 上的標記。

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

備註

Pin必須先指派其 Label 屬性,才能將其新增至地圖。 否則會擲回 System.ArgumentException

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;
}

建構函式

Pin()

使用預設值建立新的 Pin 物件。

欄位

AddressProperty

識別 Address 可繫結屬性。

LabelProperty

Label 屬性的備份存放區。

PositionProperty

識別 Position 可繫結屬性。

TypeProperty

識別 PinType 可繫結屬性。

屬性

Address

,描述街道地址。

AutomationId

取得或設定值,允許自動化架構尋找此項目並與之互動。

(繼承來源 Element)
BindingContext

取得或設定物件,這個物件包含屬於此 BindableObject 屬性繫結屬性將設為目標的屬性。

(繼承來源 BindableObject)
ClassId

取得或設定值,用來識別語意類似項目的集合。

(繼承來源 Element)
Dispatcher

Map 上的標記。

(繼承來源 BindableObject)
EffectControlProvider

供 Xamarin.Forms 平台內部使用。

(繼承來源 Element)
Effects

套用至此項目的效果清單。

(繼承來源 Element)
Id
已淘汰.

供 Xamarin.Forms 平台內部使用。

Label

Pin 建立關聯之可供使用者讀取的 。

LogicalChildren

供 Xamarin.Forms 平台內部使用。

(繼承來源 Element)
MarkerId

供 Xamarin.Forms 平台內部使用。

Parent

取得或設定項目的父項目。

(繼承來源 Element)
ParentView
已淘汰.

取得即此項目最接近上階的項目,而此項目是 VisualElement

(繼承來源 Element)
Platform
已淘汰.

Map 上的標記。

(繼承來源 Element)
Position

Pin 的緯度和經度。

RealParent

供 Xamarin.Forms 平台內部使用。

(繼承來源 Element)
StyleId

取得或設定使用者定義值來唯一識別項目。

(繼承來源 Element)
Type

釘選類型。

方法

ApplyBindings()

將繫結套用至 BindingContext

(繼承來源 BindableObject)
ClearValue(BindableProperty)

清除 SetValue 針對 property 所設定的任何值。

(繼承來源 BindableObject)
ClearValue(BindablePropertyKey)

清除 SetValue 針對 propertyKey 所識別屬性設定的任何值。

(繼承來源 BindableObject)
CoerceValue(BindableProperty)

Map 上的標記。

(繼承來源 BindableObject)
CoerceValue(BindablePropertyKey)

Map 上的標記。

(繼承來源 BindableObject)
Descendants()

供 Xamarin.Forms 平台內部使用。

(繼承來源 Element)
EffectIsAttached(String)

供 Xamarin.Forms 平台內部使用。

(繼承來源 Element)
Equals(Object)

obj 是否具有對等 TypePositionLabelAddress

FindByName(String)

傳回具有指定名稱的元素。

(繼承來源 Element)
GetHashCode()

Pin 的雜湊值

GetValue(BindableProperty)

傳回 BindableProperty 中包含的值。

(繼承來源 BindableObject)
GetValues(BindableProperty, BindableProperty)
已淘汰.

供 Xamarin.Forms 平台內部使用。

(繼承來源 BindableObject)
GetValues(BindableProperty, BindableProperty, BindableProperty)
已淘汰.

供 Xamarin.Forms 平台內部使用。

(繼承來源 BindableObject)
IsSet(BindableProperty)

如果目標屬性存在且已設定,則傳回 true

(繼承來源 BindableObject)
OnBindingContextChanged()

只要項目的繫結內容變更時就叫用。 實作這個方法可為此事件加入類別處理。

(繼承來源 Element)
OnChildAdded(Element)

只要需要發出 ChildAdded 事件時即叫用。 實作這個方法可為此事件加入類別處理。

(繼承來源 Element)
OnChildRemoved(Element)
已淘汰.

只要需要發出 ChildRemoved 事件時即叫用。 實作這個方法可為此事件加入類別處理。

(繼承來源 Element)
OnChildRemoved(Element, Int32)

Map 上的標記。

(繼承來源 Element)
OnParentSet()

每當設定項目的父系時叫用。 實作這個方法,以便在項目新增至父系時新增行為。

(繼承來源 Element)
OnPropertyChanged(String)

繫結屬性變更時呼叫的方法。

(繼承來源 Element)
OnPropertyChanging(String)

從子類別呼叫這個方法,以通知屬性即將發生變更。

(繼承來源 BindableObject)
RemoveBinding(BindableProperty)

移除先前設定的繫結。

(繼承來源 BindableObject)
RemoveDynamicResource(BindableProperty)

移除先前設定的動態資源

(繼承來源 Element)
SendInfoWindowClick()

Map 上的標記。

SendMarkerClick()

Map 上的標記。

SendTap()
已淘汰.

供 Xamarin.Forms 平台內部使用。

SetBinding(BindableProperty, BindingBase)

將繫結指派給屬性。

(繼承來源 BindableObject)
SetDynamicResource(BindableProperty, String)

透過具有所提供索引鍵的 DynamicResource,設定更新此項目的 BindableProperty 屬性。

(繼承來源 Element)
SetValue(BindableProperty, Object)

設定指定之屬性的值。

(繼承來源 BindableObject)
SetValue(BindablePropertyKey, Object)

設定 propertyKey 的值。

(繼承來源 BindableObject)
SetValueCore(BindableProperty, Object, SetValueFlags)

供 Xamarin.Forms 平台內部使用。

(繼承來源 BindableObject)
SetValueFromRenderer(BindableProperty, Object)

供 Xamarin.Forms 平台內部使用。

(繼承來源 Element)
SetValueFromRenderer(BindablePropertyKey, Object)

供 Xamarin.Forms 平台內部使用。

(繼承來源 Element)
UnapplyBindings()

取消套用所有先前設定的繫結。

(繼承來源 BindableObject)

運算子

Equality(Pin, Pin)

leftright 是否有對等的 TypePositionLabelAddress 值。

Inequality(Pin, Pin)

leftrightTypePositionLabelAddress 值是否有任何不同。

事件

BindingContextChanged

每當 BindingContext 屬性變更時引發。

(繼承來源 BindableObject)
ChildAdded

只要將子項目新增至項目時就發生。

(繼承來源 Element)
ChildRemoved

只要從項目移除子項目時就發生。

(繼承來源 Element)
Clicked
已淘汰.

按釘選時所引發的事件。

DescendantAdded

只要將子項目新增至項目樹狀子目錄時即發生。

(繼承來源 Element)
DescendantRemoved

只要從項目樹狀子目錄移除子項目時即發生。

(繼承來源 Element)
InfoWindowClicked

Map 上的標記。

MarkerClicked

Map 上的標記。

PlatformSet
已淘汰.

Map 上的標記。

(繼承來源 Element)
PropertyChanged

在屬性變更時引發。

(繼承來源 BindableObject)
PropertyChanging

在屬性即將變更時引發。

(繼承來源 BindableObject)

明確介面實作

IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

供 Xamarin.Forms 平台內部使用。

(繼承來源 BindableObject)
IElementController.SetValueFromRenderer(BindableProperty, Object)

供 Xamarin.Forms 平台內部使用。

(繼承來源 Element)
INameScope.RegisterName(String, Object)

僅供內部使用。

(繼承來源 Element)

擴充方法

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

Map 上的標記。

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

Map 上的標記。

SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)

建立並將繫結套用至屬性。

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

從運算式建立及套用繫結。

SetOnAppTheme<T>(BindableObject, BindableProperty, T, T)

Map 上的標記。

FindByName<T>(Element, String)

傳回包含 element 的範圍中具有 name 名稱的 T 類型執行個體。

適用於