Xamarin.Forms Guides | Samples

Xamarin.Forms.BindableProperty.Create Method

Creates a new instance of the BindableProperty class.

Syntax

public static BindableProperty Create (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
defaultValueCreator
A Func used to initialize default value for reference types..

Returns

A newly created BindableProperty.

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