BindableProperty.CreateAttachedReadOnly BindableProperty.CreateAttachedReadOnly Method

Definition

Overloads

CreateAttachedReadOnly(String, Type, Type, Object, BindingMode, BindableProperty+ValidateValueDelegate, BindableProperty+BindingPropertyChangedDelegate, BindableProperty+BindingPropertyChangingDelegate, BindableProperty+CoerceValueDelegate, BindableProperty+CreateDefaultValueDelegate) CreateAttachedReadOnly(String, Type, Type, Object, BindingMode, BindableProperty+ValidateValueDelegate, BindableProperty+BindingPropertyChangedDelegate, BindableProperty+BindingPropertyChangingDelegate, BindableProperty+CoerceValueDelegate, BindableProperty+CreateDefaultValueDelegate)

Creates a new instance of the BindableProperty class for attached read-only properties.

CreateAttachedReadOnly<TDeclarer,TPropertyType>(Expression<Func<BindableObject,TPropertyType>>, TPropertyType, BindingMode, BindableProperty, BindableProperty, BindableProperty, BindableProperty, BindableProperty) CreateAttachedReadOnly<TDeclarer,TPropertyType>(Expression<Func<BindableObject,TPropertyType>>, TPropertyType, BindingMode, BindableProperty, BindableProperty, BindableProperty, BindableProperty, BindableProperty)

Deprecated. Do not use.

CreateAttachedReadOnly(String, Type, Type, Object, BindingMode, BindableProperty+ValidateValueDelegate, BindableProperty+BindingPropertyChangedDelegate, BindableProperty+BindingPropertyChangingDelegate, BindableProperty+CoerceValueDelegate, BindableProperty+CreateDefaultValueDelegate) CreateAttachedReadOnly(String, Type, Type, Object, BindingMode, BindableProperty+ValidateValueDelegate, BindableProperty+BindingPropertyChangedDelegate, BindableProperty+BindingPropertyChangingDelegate, BindableProperty+CoerceValueDelegate, BindableProperty+CreateDefaultValueDelegate)

Creates a new instance of the BindableProperty class for attached read-only properties.

public static Xamarin.Forms.BindablePropertyKey CreateAttachedReadOnly (string propertyName, Type returnType, Type declaringType, object defaultValue, Xamarin.Forms.BindingMode defaultBindingMode = Xamarin.Forms.BindingMode.OneWayToSource, Xamarin.Forms.BindableProperty.ValidateValueDelegate validateValue = null, Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate propertyChanged = null, Xamarin.Forms.BindableProperty.BindingPropertyChangingDelegate propertyChanging = null, Xamarin.Forms.BindableProperty.CoerceValueDelegate coerceValue = null, Xamarin.Forms.BindableProperty.CreateDefaultValueDelegate defaultValueCreator = null);
static member CreateAttachedReadOnly : string * Type * Type * obj * Xamarin.Forms.BindingMode * Xamarin.Forms.BindableProperty.ValidateValueDelegate * Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate * Xamarin.Forms.BindableProperty.BindingPropertyChangingDelegate * Xamarin.Forms.BindableProperty.CoerceValueDelegate * Xamarin.Forms.BindableProperty.CreateDefaultValueDelegate -> Xamarin.Forms.BindablePropertyKey
Parameters
propertyName
String String

The name of the BindableProperty.

returnType
Type Type

The type of the property.

declaringType
Type Type

The type of the declaring object.

defaultValue
Object Object

The default value for the property.

defaultBindingMode
BindingMode BindingMode

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 read-only BindableProperty.

Remarks

Attached properties are bindable properties that are bound to an object other than their parent. Often, they are used for child items in tables and grids, where data about the location of an item is maintained by its parent, but must be accessed from the child item itself.

CreateAttachedReadOnly<TDeclarer,TPropertyType>(Expression<Func<BindableObject,TPropertyType>>, TPropertyType, BindingMode, BindableProperty, BindableProperty, BindableProperty, BindableProperty, BindableProperty) CreateAttachedReadOnly<TDeclarer,TPropertyType>(Expression<Func<BindableObject,TPropertyType>>, TPropertyType, BindingMode, BindableProperty, BindableProperty, BindableProperty, BindableProperty, BindableProperty)

Warning

This API is now obsolete.

Deprecated. Do not use.

[System.Obsolete("CreateAttachedReadOnly<> (generic) is obsolete as of version 2.1.0 and is no longer supported.")]
public static Xamarin.Forms.BindablePropertyKey CreateAttachedReadOnly<TDeclarer,TPropertyType> (System.Linq.Expressions.Expression<Func<Xamarin.Forms.BindableObject,TPropertyType>> staticgetter, TPropertyType defaultValue, Xamarin.Forms.BindingMode defaultBindingMode = Xamarin.Forms.BindingMode.OneWayToSource, Xamarin.Forms.BindableProperty.ValidateValueDelegate<TPropertyType> validateValue = null, Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate<TPropertyType> propertyChanged = null, Xamarin.Forms.BindableProperty.BindingPropertyChangingDelegate<TPropertyType> propertyChanging = null, Xamarin.Forms.BindableProperty.CoerceValueDelegate<TPropertyType> coerceValue = null, Xamarin.Forms.BindableProperty.CreateDefaultValueDelegate<Xamarin.Forms.BindableObject,TPropertyType> defaultValueCreator = null);
static member CreateAttachedReadOnly : System.Linq.Expressions.Expression<Func<Xamarin.Forms.BindableObject, 'PropertyType>> * 'PropertyType * Xamarin.Forms.BindingMode * Xamarin.Forms.BindableProperty.ValidateValueDelegate<'PropertyType> * Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate<'PropertyType> * Xamarin.Forms.BindableProperty.BindingPropertyChangingDelegate<'PropertyType> * Xamarin.Forms.BindableProperty.CoerceValueDelegate<'PropertyType> * Xamarin.Forms.BindableProperty.CreateDefaultValueDelegate<Xamarin.Forms.BindableObject, 'PropertyType> -> Xamarin.Forms.BindablePropertyKey
Type Parameters
TDeclarer

The type of the declaring object.

TPropertyType

The type of the property.

Parameters
staticgetter
Expression<Func<BindableObject,TPropertyType>>

An expression identifying a static method returning the value of the property using this BindableProperty as backing store.

defaultValue

Default value for the BindableProperty.

defaultBindingMode
BindingMode BindingMode

The BindingMode to use on SetBinding() if no BindingMode is given. This parameter is optional. Default is BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate<TPropertyType>

A delegate to be run when a value is set. This parameter is optional. Default is null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate<TPropertyType>

A delegate to be run when the value has changed. This parameter is optional. Default is null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate<TPropertyType>

A delegate to be run when the value will change. This parameter is optional. Default is null.

coerceValue
BindableProperty.CoerceValueDelegate<TPropertyType>

A delegate used to coerce the range of a value. This parameter is optional. Default is null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate<BindableObject,TPropertyType>

A Func used to initialize default value for reference types.

Returns

A newly created BindablePropertyKey.

Applies to