Compartir a través de


BindableProperty.Create Método

Definición

Crea una instancia de la clase BindableProperty.

public static Microsoft.Maui.Controls.BindableProperty Create (string propertyName, Type returnType, Type declaringType, object defaultValue = default, Microsoft.Maui.Controls.BindingMode defaultBindingMode = Microsoft.Maui.Controls.BindingMode.OneWay, 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 Create : 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.BindableProperty
Public Shared Function Create (propertyName As String, returnType As Type, declaringType As Type, Optional defaultValue As Object = Nothing, Optional defaultBindingMode As BindingMode = Microsoft.Maui.Controls.BindingMode.OneWay, 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 BindableProperty

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 recién creada.

Se aplica a