Sdílet prostřednictvím


BindableProperty.CreateAttached Metoda

Definice

Přetížení

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

Vytvoří novou instanci BindableProperty třídy pro připojenou vlastnost.

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

Zastaralé Nepoužívat.

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

Vytvoří novou instanci BindableProperty třídy pro připojenou vlastnost.

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

Parametry

propertyName
System.String

Název BindableProperty.

returnType
System.Type

Typ proměnné

declaringType
System.Type

Typ deklarujícího objektu.

defaultValue
System.Object

Výchozí hodnota vlastnosti.

defaultBindingMode
BindingMode

BindingMode použít v SetBinding(), pokud není zadaný žádný BindingMode. Tento parametr je volitelný. Výchozí hodnota je BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate

Delegát, který se má spustit, když je nastavená hodnota. Tento parametr je volitelný. Výchozí hodnota je null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate

Delegát, který se má spustit, když se hodnota změnila. Tento parametr je volitelný. Výchozí hodnota je null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate

Delegát, který se má spustit, když se hodnota změní. Tento parametr je volitelný. Výchozí hodnota je null.

coerceValue
BindableProperty.CoerceValueDelegate

Delegát, který slouží k přetěžování rozsahu hodnoty. Tento parametr je volitelný. Výchozí hodnota je null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate

Func použitý k inicializaci výchozí hodnoty pro odkazové typy.

Návraty

Nově vytvořené připojené BindableProperty.

Platí pro

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

Upozornění

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

Zastaralé Nepoužívat.

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

Parametry typu

TDeclarer

Typ deklarujícího objektu.

TPropertyType

Typ proměnné

Parametry

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

Výraz identifikující statickou metodu vracející hodnotu vlastnosti pomocí tohoto BindableProperty jako záložního úložiště.

defaultValue
TPropertyType

Výchozí hodnota pro BindableProperty.

defaultBindingMode
BindingMode

BindingMode použít v SetBinding(), pokud není zadaný žádný BindingMode. Tento parametr je volitelný. Výchozí hodnota je BindingMode.OneWay.

validateValue
BindableProperty.ValidateValueDelegate<TPropertyType>

Delegát, který se má spustit, když je nastavená hodnota. Tento parametr je volitelný. Výchozí hodnota je null.

propertyChanged
BindableProperty.BindingPropertyChangedDelegate<TPropertyType>

Delegát, který se má spustit, když se hodnota změnila. Tento parametr je volitelný. Výchozí hodnota je null.

propertyChanging
BindableProperty.BindingPropertyChangingDelegate<TPropertyType>

Delegát, který se má spustit, když se hodnota změní. Tento parametr je volitelný. Výchozí hodnota je null.

coerceValue
BindableProperty.CoerceValueDelegate<TPropertyType>

Delegát, který slouží k přetěžování rozsahu hodnoty. Tento parametr je volitelný. Výchozí hodnota je null.

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate<BindableObject,TPropertyType>

Func použitý k inicializaci výchozí hodnoty pro odkazové typy.

Návraty

Nově vytvořený BindableProperty.

Atributy
System.ComponentModel.EditorBrowsableAttribute System.ObsoleteAttribute

Poznámky

Připojené vlastnosti jsou vázatelné vlastnosti, které jsou svázány s jiným objektem, než je jejich nadřazený objekt. Často se používají pro podřízené položky v tabulkách a mřížkách, kde jsou data o umístění položky udržována nadřazenou položkou, ale musí být přístupná ze samotné podřízené položky.

Platí pro