Partager via


BindableProperty.CreateAttachedReadOnly Méthode

Définition

Surcharges

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

Crée une instance de la classe BindableProperty pour des propriétés jointes en lecture seule.

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

Obsolète. Ne pas utiliser.

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

Crée une instance de la classe BindableProperty pour des propriétés jointes en lecture seule.

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 = 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 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

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

BindableProperty joint en lecture seule nouvellement créé.

Remarques

Les propriétés jointes sont des propriétés pouvant être liées à un objet autre que leur parent. Souvent, ils sont utilisés pour les éléments enfants dans les tables et les grilles, où les données sur l’emplacement d’un élément sont conservées par son parent, mais doivent être accessibles à partir de l’élément enfant lui-même.

S’applique à

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

Attention

CreateAttachedReadOnly<> (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("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 = 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 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

Paramètres de type

TDeclarer

Type de l’objet de déclaration.

TPropertyType

Type de la propriété.

Paramètres

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

Expression identifiant une méthode statique retournant la valeur 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<BindableObject,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

S’applique à