DependencyObject.Equals(Object) DependencyObject.Equals(Object) DependencyObject.Equals(Object) DependencyObject.Equals(Object) Method


确定提供的 DependencyObject 是否等效于当前 DependencyObjectDetermines whether a provided DependencyObject is equivalent to the current DependencyObject.

 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


Object Object Object Object

要与当前实例进行比较的 DependencyObjectThe DependencyObject to compare to the current instance.


如果两个实例相同,则为 true;否则为 falsetrue if the two instances are the same; otherwise, false.


此实现是引用相等性,且不会尝试评估所包含属性的值相等性。This implementation is reference equality only, and does not attempt to evaluate value equality of the contained properties.


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. 这些故意安排的重写的目的是为了防止派生的类尝试定义值相等性DependencyObjectThe purpose of these deliberate overrides is to prevent derived classes from trying to define a value equality for a DependencyObject. 值相等性DependencyObject永远不会是准确的将由于固有的属性值更改功能的DependencyObject及其依赖项属性。Value equalities for DependencyObject will never be accurate because of the innate property value-changing capabilities of a DependencyObject and its dependency properties. 这包括基本WPFWPF功能,例如数据绑定和WPFWPF属性系统。This includes fundamental WPFWPF features such as data binding and the WPFWPF property system.