Share via


BindableProperty.CreateAttached Método

Definición

Sobrecargas

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

Crea una instancia de la clase BindableProperty para una propiedad adjunta.

CreateAttached<TDeclarer,TPropertyType>(Expression<Func<BindableObject, TPropertyType>>, TPropertyType, BindingMode, BindableProperty.ValidateValueDelegate<TPropertyType>, BindableProperty.BindingPropertyChangedDelegate<TPropertyType>, BindableProperty.BindingPropertyChangingDelegate<TPropertyType>, BindableProperty.CoerceValueDelegate<TPropertyType>, BindableProperty.CreateDefaultValueDelegate<BindableObject, TPropertyType>)
Obsoletos.

Desusado. No utilizar.

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

Crea una instancia de la clase BindableProperty para una propiedad adjunta.

public static Xamarin.Forms.BindableProperty CreateAttached (string propertyName, Type returnType, Type declaringType, object defaultValue, Xamarin.Forms.BindingMode defaultBindingMode = Xamarin.Forms.BindingMode.OneWay, Xamarin.Forms.BindableProperty.ValidateValueDelegate validateValue = default, Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate propertyChanged = default, Xamarin.Forms.BindableProperty.BindingPropertyChangingDelegate propertyChanging = default, Xamarin.Forms.BindableProperty.CoerceValueDelegate coerceValue = default, Xamarin.Forms.BindableProperty.CreateDefaultValueDelegate defaultValueCreator = default);
static member CreateAttached : 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.BindableProperty

Parámetros

propertyName
System.String

Nombre de la BindableProperty.

returnType
System.Type

Tipo de la propiedad.

declaringType
System.Type

Tipo del objeto de declaración.

defaultValue
System.Object

Valor predeterminado de la propiedad.

defaultBindingMode
BindingMode

BindingMode que se usará en SetBinding() si no se proporciona ningún BindingMode. Este parámetro es opcional. El valor predeterminado es BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate

Delegado que se ejecutará cuando se establezca un valor. Este parámetro es opcional. El valor predeterminado es null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate

Delegado que se ejecutará cuando el valor haya cambiado. Este parámetro es opcional. El valor predeterminado es null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate

Delegado que se ejecutará cuando el valor vaya a cambiar. Este parámetro es opcional. El valor predeterminado es null.

coerceValue
BindableProperty.CoerceValueDelegate

Delegado que se usa para convertir el intervalo de un valor. Este parámetro es opcional. El valor predeterminado es null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate

Función que se usa para inicializar el valor predeterminado de los tipos de referencia.

Devoluciones

BindableProperty adjunta recién creada.

Se aplica a

CreateAttached<TDeclarer,TPropertyType>(Expression<Func<BindableObject, TPropertyType>>, TPropertyType, BindingMode, BindableProperty.ValidateValueDelegate<TPropertyType>, BindableProperty.BindingPropertyChangedDelegate<TPropertyType>, BindableProperty.BindingPropertyChangingDelegate<TPropertyType>, BindableProperty.CoerceValueDelegate<TPropertyType>, BindableProperty.CreateDefaultValueDelegate<BindableObject, TPropertyType>)

Precaución

CreateAttached<> (generic) is obsolete as of version 2.1.0 and is no longer supported.

Desusado. No utilizar.

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("CreateAttached<> (generic) is obsolete as of version 2.1.0 and is no longer supported.")]
public static Xamarin.Forms.BindableProperty CreateAttached<TDeclarer,TPropertyType> (System.Linq.Expressions.Expression<Func<Xamarin.Forms.BindableObject,TPropertyType>> staticgetter, TPropertyType defaultValue, Xamarin.Forms.BindingMode defaultBindingMode = Xamarin.Forms.BindingMode.OneWay, Xamarin.Forms.BindableProperty.ValidateValueDelegate<TPropertyType> validateValue = default, Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate<TPropertyType> propertyChanged = default, Xamarin.Forms.BindableProperty.BindingPropertyChangingDelegate<TPropertyType> propertyChanging = default, Xamarin.Forms.BindableProperty.CoerceValueDelegate<TPropertyType> coerceValue = default, Xamarin.Forms.BindableProperty.CreateDefaultValueDelegate<Xamarin.Forms.BindableObject,TPropertyType> defaultValueCreator = default);
static member CreateAttached : 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.BindableProperty

Parámetros de tipo

TDeclarer

Tipo del objeto de declaración.

TPropertyType

Tipo de la propiedad.

Parámetros

staticgetter
System.Linq.Expressions.Expression<System.Func<BindableObject,TPropertyType>>

Expresión que identifica un método estático que devuelve el valor de la propiedad usando esta propiedad BindableProperty como memoria auxiliar.

defaultValue
TPropertyType

Valor predeterminado de la propiedad BindableProperty.

defaultBindingMode
BindingMode

BindingMode que se usará en SetBinding() si no se proporciona ningún BindingMode. Este parámetro es opcional. El valor predeterminado es BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate<TPropertyType>

Delegado que se ejecutará cuando se establezca un valor. Este parámetro es opcional. El valor predeterminado es null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate<TPropertyType>

Delegado que se ejecutará cuando el valor haya cambiado. Este parámetro es opcional. El valor predeterminado es null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate<TPropertyType>

Delegado que se ejecutará cuando el valor vaya a cambiar. Este parámetro es opcional. El valor predeterminado es null.

coerceValue
BindableProperty.CoerceValueDelegate<TPropertyType>

Delegado que se usa para convertir el intervalo de un valor. Este parámetro es opcional. El valor predeterminado es null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate<BindableObject,TPropertyType>

Función que se usa para inicializar el valor predeterminado de los tipos de referencia.

Devoluciones

BindableProperty recién creada.

Atributos
System.ComponentModel.EditorBrowsableAttribute System.ObsoleteAttribute

Comentarios

Las propiedades adjuntas son propiedades enlazables que están enlazadas a un objeto distinto de su elemento primario. A menudo, se usan para elementos secundarios en tablas y cuadrículas, donde los datos sobre la ubicación de un elemento se mantienen mediante su elemento primario, pero se debe tener acceso desde el propio elemento secundario.

Se aplica a