DependencyObject.GetHashCode 方法

定義

取得這個 DependencyObject 的雜湊碼。Gets a hash code for this DependencyObject.

public:
 override int GetHashCode();
public override sealed int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides NotOverridable Function GetHashCode () As Integer

傳回

Int32

帶正負號 32 位元整數雜湊碼。A signed 32-bit integer hash code.

給繼承者的注意事項

DependencyObject 覆寫並密封兩種 Object 方法: Equals(Object)GetHashCode() DependencyObject overrides and then seals two 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. 的值 equalities 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. 這包括資料系結 [!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.

適用於