BindableProperty.CreateAttached Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Crea una instancia de la clase BindableProperty para una propiedad adjunta.
public static Microsoft.Maui.Controls.BindableProperty CreateAttached (string propertyName, Type returnType, Type declaringType, object defaultValue, 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 CreateAttached : 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 CreateAttached (propertyName As String, returnType As Type, declaringType As Type, defaultValue As Object, 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 adjunta recién creada.