本文為機器翻譯文章。如需檢視英文版,請選取 [原文] 核取方塊。您也可以將滑鼠指標移到文字上,即可在快顯視窗顯示英文原文。
譯文
原文

BindingExpression 類別

 

包含 Binding 單一執行個體的相關資訊。

命名空間:   System.Windows.Data
組件:  PresentationFramework (在 PresentationFramework.dll 中)

System.Object
  System.Windows.Expression
    System.Windows.Data.BindingExpressionBase
      System.Windows.Data.BindingExpression

public sealed class BindingExpression : BindingExpressionBase, 
	IWeakEventListener

名稱描述
System_CAPS_pubpropertyBindingGroup

取得這個繫結運算式所屬的 BindingGroup(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyDataItem

取得這個 BindingExpression 所使用的繫結來源物件。

System_CAPS_pubpropertyHasError

取得值,這個值表示父繫結是否有驗證失敗規則。(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyHasValidationError

取得值,這個值表示父繫結是否有驗證失敗規則。(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyIsDirty

取得或設定值,指出繫結目標是否有尚未寫入至來源的值。(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyParentBinding

傳回目前 BindingExpressionBinding 物件。

System_CAPS_pubpropertyParentBindingBase

取得 BindingBase 物件,這個 BindingExpressionBase 物件是從其中建立。(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyResolvedSource

取得這個 BindingExpression 的繫結來源物件。

System_CAPS_pubpropertyResolvedSourcePropertyName

取得這個 BindingExpression 的繫結來源屬性的名稱。

System_CAPS_pubpropertyStatus

取得繫結運算式的狀態。(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyTarget

取得做為此繫結運算式的繫結目標物件的項目。(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyTargetProperty

取得這個繫結運算式的繫結目標屬性。(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyValidationError

取得造成這個 BindingExpressionBase 執行個體無效的 ValidationError(繼承自 BindingExpressionBase。)

System_CAPS_pubpropertyValidationErrors

取得集合 ValidationError 造成此執行個體的物件 BindingExpressionBase 失效。(繼承自 BindingExpressionBase。)

名稱描述
System_CAPS_pubmethodEquals(Object)

判斷指定的物件是否等於目前的物件。(繼承自 Object。)

System_CAPS_pubmethodGetHashCode()

做為預設雜湊函式。(繼承自 Object。)

System_CAPS_pubmethodGetType()

取得目前執行個體的 Type(繼承自 Object。)

System_CAPS_pubmethodToString()

傳回代表目前物件的字串。(繼承自 Object。)

System_CAPS_pubmethodUpdateSource()

將目前的繫結目標值傳送至 TwoWayOneWayToSource 繫結的繫結來源屬性。(覆寫 BindingExpressionBase.UpdateSource()。)

System_CAPS_pubmethodUpdateTarget()

強制執行從繫結來源屬性至繫結目標屬性的資料傳輸。(覆寫 BindingExpressionBase.UpdateTarget()。)

System_CAPS_pubmethodValidateWithoutUpdate()

執行任何 ValidationRule 上相關聯的物件 Binding 具有 ValidationStep 屬性設定為 RawProposedValueConvertedProposedValue 這個方法不會更新來源。(繼承自 BindingExpressionBase。)

名稱描述
System_CAPS_pubinterfaceSystem_CAPS_privmethodIWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs)

這個成員支援 Windows Presentation Foundation (WPF) 基礎結構,但不建議直接使用於您的程式碼中。

The T:System.Windows.Data.Binding class is the high-level class for the declaration of a binding. The T:System.Windows.Data.BindingExpression class is the underlying object that maintains the connection between the binding source and the binding target. A T:System.Windows.Data.Binding contains all the information that can be shared across several T:System.Windows.Data.BindingExpression objects. A T:System.Windows.Data.BindingExpression is an instance expression that cannot be shared and that contains all the instance information about the T:System.Windows.Data.Binding.

For example, consider the following, where myDataObject is an instance of the MyData class, myBinding is the source T:System.Windows.Data.Binding object, and MyData class is a defined class that contains a string property named MyDataProperty. This example binds the text content of mytext, which is an instance of T:System.Windows.Controls.TextBlock, to MyDataProperty.

//make a new source
  MyData myDataObject = new MyData(DateTime.Now);      
  Binding myBinding = new Binding("MyDataProperty");
  myBinding.Source = myDataObject;
  myText.SetBinding(TextBlock.TextProperty, myBinding);

You can use the same myBinding object to create other bindings. For example, you might use the myBinding object to bind the text content of a check box to MyDataProperty. In that scenario, there will be two instances of T:System.Windows.Data.BindingExpression that share the myBinding object.

You can obtain a T:System.Windows.Data.BindingExpression object by using the M:System.Windows.Data.BindingOperations.GetBindingExpression(System.Windows.DependencyObject,System.Windows.DependencyProperty) method or the M:System.Windows.FrameworkElement.GetBindingExpression(System.Windows.DependencyProperty) method on a data-bound object.

.NET Framework
自 3.0 起可用
Silverlight
自 3.0 起可用
Windows Phone Silverlight
自 7.0 起可用

這個類型的任何公用靜態 (在 Visual Basic 中為 Shared) 成員都是安全執行緒。不保證任何執行個體成員是安全執行緒。

回到頁首
顯示: