Xamarin.Forms Guides | Samples

Xamarin.Forms.BindableProperty.CreateAttached Method

Creates a new instance of the BindableProperty class for an attached property.

Syntax

public static BindableProperty CreateAttached (String propertyName, Type returnType, Type declaringType, Object defaultValue, BindingMode defaultBindingMode, BindableProperty+ValidateValueDelegate validateValue, BindableProperty+BindingPropertyChangedDelegate propertyChanged, BindableProperty+BindingPropertyChangingDelegate propertyChanging, BindableProperty+CoerceValueDelegate coerceValue, BindableProperty+CreateDefaultValueDelegate defaultValueCreator)

Parameters

propertyName
The name of the BindableProperty.
returnType
The type of the property.
declaringType
The type of the declaring object.
defaultValue
The default value for the property.
defaultBindingMode
The BindingMode to use on SetBinding() if no BindingMode is given. This parameter is optional. Default is BindingMode.OneWay.
validateValue
A delegate to be run when a value is set. This parameter is optional. Default is null.
propertyChanged
A delegate to be run when the value has changed. This parameter is optional. Default is null.
propertyChanging
A delegate to be run when the value will change. This parameter is optional. Default is null.
coerceValue
A delegate used to coerce the range of a value. This parameter is optional. Default is null.
defaultValueCreator
A Func used to initialize default value for reference types..

Returns

A newly created attached BindableProperty.

Remarks

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.2.2.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0