BindableProperty.Create Metodo

Definizione

Overload

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

Crea una nuova istanza della classe BindableProperty.

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

Deprecato. Non usare.

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

Crea una nuova istanza della classe BindableProperty.

public static Xamarin.Forms.BindableProperty Create (string propertyName, Type returnType, Type declaringType, object defaultValue = default, 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 Create : 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
String

Il nome di BindableProperty.

returnType
Type

Tipo della proprietà.

declaringType
Type

Il tipo dell'oggetto dichiarante.

defaultValue
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 classe BindableProperty appena creata.

Si applica a

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

Attenzione

Create<> (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("Create<> (generic) is obsolete as of version 2.1.0 and is no longer supported.")]
public static Xamarin.Forms.BindableProperty Create<TDeclarer,TPropertyType> (System.Linq.Expressions.Expression<Func<TDeclarer,TPropertyType>> getter, 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<TDeclarer,TPropertyType> defaultValueCreator = default) where TDeclarer : Xamarin.Forms.BindableObject;
static member Create : System.Linq.Expressions.Expression<Func<'Declarer, '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<'Declarer, 'PropertyType (requires 'Declarer :> Xamarin.Forms.BindableObject)> -> Xamarin.Forms.BindableProperty (requires 'Declarer :> Xamarin.Forms.BindableObject)

Parametri di tipo

TDeclarer

Il tipo dell'oggetto dichiarante.

TPropertyType

Tipo della proprietà.

Parametri

getter
Expression<Func<TDeclarer,TPropertyType>>

Un'espressione che identifica il getter 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<TDeclarer,TPropertyType>

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

Restituisce

Una classe BindableProperty appena creata.

Attributi

Si applica a