DependencyObject.Equals(Object) Method

Definition

判斷提供的 DependencyObject 和目前的 DependencyObject 是否相等。Determines whether a provided DependencyObject is equivalent to the current DependencyObject.

public:
 override bool Equals(System::Object ^ obj);
public override sealed bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides NotOverridable Function Equals (obj As Object) As Boolean

Parameters

obj
Object

要與目前執行個體相比較的 DependencyObjectThe DependencyObject to compare to the current instance.

Returns

Boolean

如果兩個執行個體相等,就是 true,否則就是 false.true if the two instances are the same; otherwise, false.

Remarks

這個實值只是參考相等,而且不會嘗試評估所包含屬性的值是否相等。This implementation is reference equality only, and does not attempt to evaluate value equality of the contained properties.

Notes to Inheritors

DependencyObject 覆寫,然後密封兩個基本的 Object 方法: Equals(Object)GetHashCode() DependencyObject overrides and then seals two basic Object methods: Equals(Object) and GetHashCode(). 覆寫會呼叫 Object 的實作為,因而導致物件相等的行為。The overrides call the Object implementations, resulting in an object equality behavior. 這些刻意覆寫的目的是要防止衍生類別嘗試定義 DependencyObject的值相等。The purpose of these deliberate overrides is to prevent derived classes from trying to define a value equality for a DependencyObject. DependencyObject 的值 equalities 永遠不會正確,因為 DependencyObject 的固有屬性值變更功能及其相依性屬性。Value equalities for DependencyObject will never be accurate because of the innate property value-changing capabilities of a DependencyObject and its dependency properties. 這包括基本的 [!INCLUDE[TLA2#tla_winclient](~/includes/tla2sharptla-winclient-md.md)] 功能,例如資料系結和 [!INCLUDE[TLA2#tla_winclient](~/includes/tla2sharptla-winclient-md.md)] 屬性系統。This includes fundamental [!INCLUDE[TLA2#tla_winclient](~/includes/tla2sharptla-winclient-md.md)] features such as data binding and the [!INCLUDE[TLA2#tla_winclient](~/includes/tla2sharptla-winclient-md.md)] property system.

Applies to