BindingExpression クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Bindingの 1 つのインスタンスに関する情報を格納します。
public ref class BindingExpression sealed : System::Windows::Data::BindingExpressionBase, System::Windows::IWeakEventListener
public sealed class BindingExpression : System.Windows.Data.BindingExpressionBase, System.Windows.IWeakEventListener
type BindingExpression = class
inherit BindingExpressionBase
interface IWeakEventListener
Public NotInheritable Class BindingExpression
Inherits BindingExpressionBase
Implements IWeakEventListener
- 継承
- 実装
注釈
Binding クラスは、バインディングの宣言の高レベル クラスです。 BindingExpression クラスは、バインディング ソースとバインディング ターゲットの間の接続を維持する基になるオブジェクトです。 Bindingには、複数のBindingExpression オブジェクト間で共有できるすべての情報が含まれています。 BindingExpressionは、共有できず、Bindingに関するすべてのインスタンス情報を含むインスタンス式です。
たとえば、 myDataObject が MyData クラスのインスタンスである場合、 myBinding はソース Binding オブジェクトであり、 MyData クラスは MyDataProperty という名前の文字列プロパティを含む定義済みのクラスであるとします。 次の使用例は、TextBlockのインスタンスであるmytextのテキスト コンテンツをMyDataPropertyにバインドします。
// Make a new source.
MyData myDataObject = new MyData(DateTime.Now);
Binding myBinding = new Binding("MyDataProperty");
myBinding.Source = myDataObject;
// Bind the new data source to the myText TextBlock control's Text dependency property.
myText.SetBinding(TextBlock.TextProperty, myBinding);
' Make a new source.
Dim data1 As New MyData(DateTime.Now)
Dim binding1 As New Binding("MyDataProperty")
binding1.Source = data1
' Bind the new data source to the myText TextBlock control's Text dependency property.
Me.myText.SetBinding(TextBlock.TextProperty, binding1)
同じ myBinding オブジェクトを使用して、他のバインドを作成できます。 たとえば、 myBinding オブジェクトを使用して、チェック ボックスのテキスト コンテンツを MyDataPropertyにバインドできます。 そのシナリオでは、myBinding オブジェクトを共有するBindingExpressionのインスタンスが 2 つあります。
BindingExpression オブジェクトは、データ バインド オブジェクトの GetBindingExpression メソッドまたは GetBindingExpression メソッドを使用して取得できます。
プロパティ
メソッド
| 名前 | 説明 |
|---|---|
| Equals(Object) |
指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
| GetHashCode() |
既定のハッシュ関数として機能します。 (継承元 Object) |
| GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
| MemberwiseClone() |
現在の Objectの簡易コピーを作成します。 (継承元 Object) |
| ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
| UpdateSource() |
現在のバインディング ターゲット値を、 TwoWay または OneWayToSource バインドのバインディング ソース プロパティに送信します。 |
| UpdateTarget() |
バインディング ソース プロパティからバインディング ターゲット プロパティへのデータ転送を強制します。 |
| ValidateWithoutUpdate() |
ValidationRule プロパティがBindingまたはValidationStepに設定されている、関連付けられているRawProposedValueでConvertedProposedValue オブジェクトを実行します。 このメソッドはソースを更新しません。 (継承元 BindingExpressionBase) |
明示的なインターフェイスの実装
| 名前 | 説明 |
|---|---|
| IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs) |
このメンバーは、Windows Presentation Foundation (WPF) インフラストラクチャをサポートしており、コードから直接使用するためのものではありません。 |