Compartir a través de


BindableProperty.CreateAttachedReadOnly Método

Definición

Crea una instancia de la clase BindableProperty para las propiedades de solo lectura adjuntas.

public static Microsoft.Maui.Controls.BindablePropertyKey CreateAttachedReadOnly (string propertyName, Type returnType, Type declaringType, object defaultValue, Microsoft.Maui.Controls.BindingMode defaultBindingMode = Microsoft.Maui.Controls.BindingMode.OneWayToSource, Microsoft.Maui.Controls.BindableProperty.ValidateValueDelegate validateValue = default, Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate propertyChanged = default, Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangingDelegate propertyChanging = default, Microsoft.Maui.Controls.BindableProperty.CoerceValueDelegate coerceValue = default, Microsoft.Maui.Controls.BindableProperty.CreateDefaultValueDelegate defaultValueCreator = default);
static member CreateAttachedReadOnly : string * Type * Type * obj * Microsoft.Maui.Controls.BindingMode * Microsoft.Maui.Controls.BindableProperty.ValidateValueDelegate * Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate * Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangingDelegate * Microsoft.Maui.Controls.BindableProperty.CoerceValueDelegate * Microsoft.Maui.Controls.BindableProperty.CreateDefaultValueDelegate -> Microsoft.Maui.Controls.BindablePropertyKey
Public Shared Function CreateAttachedReadOnly (propertyName As String, returnType As Type, declaringType As Type, defaultValue As Object, Optional defaultBindingMode As BindingMode = Microsoft.Maui.Controls.BindingMode.OneWayToSource, Optional validateValue As BindableProperty.ValidateValueDelegate = Nothing, Optional propertyChanged As BindableProperty.BindingPropertyChangedDelegate = Nothing, Optional propertyChanging As BindableProperty.BindingPropertyChangingDelegate = Nothing, Optional coerceValue As BindableProperty.CoerceValueDelegate = Nothing, Optional defaultValueCreator As BindableProperty.CreateDefaultValueDelegate = Nothing) As BindablePropertyKey

Parámetros

propertyName
String

Nombre de la BindableProperty.

returnType
Type

Tipo de la propiedad.

declaringType
Type

Tipo del objeto de declaración.

defaultValue
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 de solo lectura adjunta recién creada.

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