次の方法で共有


BindableProperty.CreateAttachedReadOnly メソッド

定義

読み取り専用の添付プロパティ用の BindableProperty クラスの新しいインスタンスを作成します。

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

パラメーター

propertyName
String

BindableProperty の名前。

returnType
Type

プロパティの型。

declaringType
Type

宣言オブジェクトの型。

defaultValue
Object

プロパティの既定値。

defaultBindingMode
BindingMode

BindingMode が指定されていない場合に SetBinding() で使用する BindingMode。 このパラメーターは省略できます。 既定値は BindingMode.OneWay です。

validateValue
BindableProperty.ValidateValueDelegate

値の設定時に実行されるデリゲート。 このパラメーターは省略できます。 既定値は null です。

propertyChanged
BindableProperty.BindingPropertyChangedDelegate

値が変更されたときに実行されるデリゲート。 このパラメーターは省略できます。 既定値は null です。

propertyChanging
BindableProperty.BindingPropertyChangingDelegate

値が変更されるときに実行されるデリゲート。 このパラメーターは省略できます。 既定値は null です。

coerceValue
BindableProperty.CoerceValueDelegate

値の範囲を強制するために使用されるデリゲート。 このパラメーターは省略できます。 既定値は null です。

defaultValueCreator
BindableProperty.CreateDefaultValueDelegate

参照型の既定値を初期化するために使用される関数。

戻り値

新しく作成された読み取り専用の添付 BindableProperty。

注釈

添付プロパティは、親以外のオブジェクトにバインドされるバインド可能なプロパティです。 多くの場合、これらはテーブルやグリッド内の子項目に使用されます。項目の場所に関するデータは親によって管理されますが、子項目自体からアクセスする必要があります。

適用対象