Share via


BindableProperty.CreateReadOnly Méthode

Définition

Surcharges

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

Crée une instance de la classe BindablePropertyKey.

CreateReadOnly<TDeclarer,TPropertyType>(Expression<Func<TDeclarer, TPropertyType>>, TPropertyType, BindingMode, BindableProperty.ValidateValueDelegate<TPropertyType>, BindableProperty.BindingPropertyChangedDelegate<TPropertyType>, BindableProperty.BindingPropertyChangingDelegate<TPropertyType>, BindableProperty.CoerceValueDelegate<TPropertyType>, BindableProperty.CreateDefaultValueDelegate<TDeclarer, TPropertyType>)
Obsolète.

Obsolète. Ne pas utiliser.

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

Crée une instance de la classe BindablePropertyKey.

public static Xamarin.Forms.BindablePropertyKey CreateReadOnly (string propertyName, Type returnType, Type declaringType, object defaultValue, Xamarin.Forms.BindingMode defaultBindingMode = Xamarin.Forms.BindingMode.OneWayToSource, 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 CreateReadOnly : 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

Paramètres

propertyName
System.String

Nom de BindableProperty.

returnType
System.Type

Type de la propriété.

declaringType
System.Type

Type de l’objet de déclaration.

defaultValue
System.Object

Valeur par défaut de la propriété.

defaultBindingMode
BindingMode

BindingMode à utiliser sur SetBinding() si aucun BindingMode n’est donné. Ce paramètre est optionnel. La valeur par défaut est BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate

Délégué à exécuter quand une valeur est définie. Ce paramètre est optionnel. La valeur par défaut est null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate

Délégué à exécuter quand une valeur a changé. Ce paramètre est optionnel. La valeur par défaut est null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate

Délégué à exécuter quand la valeur change. Ce paramètre est optionnel. La valeur par défaut est null.

coerceValue
BindableProperty.CoerceValueDelegate

Délégué utilisé pour forcer la plage d’une valeur. Ce paramètre est optionnel. La valeur par défaut est null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate

Fonction utilisée pour initialiser la valeur par défaut des types référence.

Retours

S’applique à

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

Attention

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

Obsolète. Ne pas utiliser.

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("CreateReadOnly<> (generic) is obsolete as of version 2.1.0 and is no longer supported.")]
public static Xamarin.Forms.BindablePropertyKey CreateReadOnly<TDeclarer,TPropertyType> (System.Linq.Expressions.Expression<Func<TDeclarer,TPropertyType>> getter, TPropertyType defaultValue, Xamarin.Forms.BindingMode defaultBindingMode = Xamarin.Forms.BindingMode.OneWayToSource, 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 CreateReadOnly : 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.BindablePropertyKey (requires 'Declarer :> Xamarin.Forms.BindableObject)

Paramètres de type

TDeclarer

Type de l’objet de déclaration.

TPropertyType

Type de la propriété.

Paramètres

getter
System.Linq.Expressions.Expression<System.Func<TDeclarer,TPropertyType>>

Expression identifiant le getter de la propriété à l’aide de ce BindableProperty comme magasin de stockage.

defaultValue
TPropertyType

Valeur par défaut de BindableProperty.

defaultBindingMode
BindingMode

BindingMode à utiliser sur SetBinding() si aucun BindingMode n’est donné. Ce paramètre est optionnel. La valeur par défaut est BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate<TPropertyType>

Délégué à exécuter quand une valeur est définie. Ce paramètre est optionnel. La valeur par défaut est null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate<TPropertyType>

Délégué à exécuter quand une valeur a changé. Ce paramètre est optionnel. La valeur par défaut est null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate<TPropertyType>

Délégué à exécuter quand la valeur change. Ce paramètre est optionnel. La valeur par défaut est null.

coerceValue
BindableProperty.CoerceValueDelegate<TPropertyType>

Délégué utilisé pour forcer la plage d’une valeur. Ce paramètre est optionnel. La valeur par défaut est null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate<TDeclarer,TPropertyType>

Fonction utilisée pour initialiser la valeur par défaut des types référence.

Retours

BindablePropertyKey nouvellement créé.

Attributs
System.ComponentModel.EditorBrowsableAttribute System.ObsoleteAttribute

Remarques

Une propriété BindablePropertyKey est utilisée pour restreindre l’accès en écriture à une propriété, via SetValue() ou une liaison. Une propriété BindableProperty est généralement également définie pour accorder un accès en lecture plus large

S’applique à