BindableProperty.CreateAttached Metodo

Definizione

Overload

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

Crea una nuova istanza della classe BindableProperty per una proprietà associata.

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>)
Obsoleti.

Deprecato. Non usare.

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

Crea una nuova istanza della classe BindableProperty per una proprietà associata.

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

Parametri

propertyName
System.String

Il nome di BindableProperty.

returnType
System.Type

Tipo della proprietà.

declaringType
System.Type

Il tipo dell'oggetto dichiarante.

defaultValue
System.Object

Il valore predefinito per la proprietà.

defaultBindingMode
BindingMode

BindingMode da usare in SetBinding() se BindingMode non è specificato. Questo parametro è facoltativo. Il valore predefinito è BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate

Un delegato da eseguire quando viene impostato un valore. Questo parametro è facoltativo. Il valore predefinito è null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate

Un delegato da eseguire quando è stato modificato il valore. Questo parametro è facoltativo. Il valore predefinito è null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate

Un delegato da eseguire quando verrà modificato il valore. Questo parametro è facoltativo. Il valore predefinito è null.

coerceValue
BindableProperty.CoerceValueDelegate

Un delegato usato per assegnare l'intervallo di un valore. Questo parametro è facoltativo. Il valore predefinito è null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate

Una funzione usata per inizializzare il valore predefinito per i tipi di riferimento.

Restituisce

Una BindableProperty associata appena creata.

Si applica 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>)

Attenzione

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

Deprecato. Non usare.

[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

Parametri di tipo

TDeclarer

Il tipo dell'oggetto dichiarante.

TPropertyType

Tipo della proprietà.

Parametri

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

Un'espressione che identifica un metodo statico che restituisce il valore della proprietà usando BindableProperty come archivio di backup.

defaultValue
TPropertyType

Il valore predefinito di BindableProperty.

defaultBindingMode
BindingMode

BindingMode da usare in SetBinding() se BindingMode non è specificato. Questo parametro è facoltativo. Il valore predefinito è BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate<TPropertyType>

Un delegato da eseguire quando viene impostato un valore. Questo parametro è facoltativo. Il valore predefinito è null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate<TPropertyType>

Un delegato da eseguire quando è stato modificato il valore. Questo parametro è facoltativo. Il valore predefinito è null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate<TPropertyType>

Un delegato da eseguire quando verrà modificato il valore. Questo parametro è facoltativo. Il valore predefinito è null.

coerceValue
BindableProperty.CoerceValueDelegate<TPropertyType>

Un delegato usato per assegnare l'intervallo di un valore. Questo parametro è facoltativo. Il valore predefinito è null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate<BindableObject,TPropertyType>

Una funzione usata per inizializzare il valore predefinito per i tipi di riferimento.

Restituisce

Una classe BindableProperty appena creata.

Attributi
System.ComponentModel.EditorBrowsableAttribute System.ObsoleteAttribute

Commenti

Le proprietà associate sono proprietà associabili associate a un oggetto diverso dal relativo padre. Spesso vengono usati per gli elementi figlio in tabelle e griglie, in cui i dati relativi alla posizione di un elemento vengono mantenuti dal relativo elemento padre, ma devono essere accessibili dall'elemento figlio stesso.

Si applica a