Freezable.FreezeCore(Boolean) 方法


使 Freezable 对象变为不可修改或测试是否可将其变为不可修改。Makes the Freezable object unmodifiable or tests whether it can be made unmodifiable.

 virtual bool FreezeCore(bool isChecking);
protected virtual bool FreezeCore (bool isChecking);
abstract member FreezeCore : bool -> bool
override this.FreezeCore : bool -> bool
Protected Overridable Function FreezeCore (isChecking As Boolean) As Boolean



若为 true,则返回是否可冻结对象的指示(不实际冻结对象);若为 false,则实际冻结对象。true to return an indication of whether the object can be frozen (without actually freezing it); false to actually freeze the object.


isCheckingtrue 时,如果可以将 Freezable 变为不可修改,则此方法返回 true;如果无法将其变为不可修改,则返回 falseIf isChecking is true, this method returns true if the Freezable can be made unmodifiable, or false if it cannot be made unmodifiable. isCheckingfalse 时,如果指定的 Freezable 目前已经不可修改,则此方法返回 true,如果无法将其变为不可修改,则返回 falseIf isChecking is false, this method returns true if the if the specified Freezable is now unmodifiable, or false if it cannot be made unmodifiable.


请勿直接调用此方法(在实现中调用基时除外)。Do not call this method directly (except when calling base in an implementation). 此方法由 CanFreeze 属性(isChecking 等于 true)和 Freeze 方法(isChecking 等于 false)在内部调用。This method is called internally by the CanFreeze property (with isChecking equal to true) and the Freeze method (with isChecking equal to false).


如果类包含未使用依赖项属性存储的数据,则 Freezable 实现程序必须重写此方法。 Freezable implementers must override this method when the class contains data that is not stored using dependency properties.

典型的实现将调用 base,然后对该类包含的所有 Freezable 类型属性调用静态 Freeze(Freezable, Boolean) 方法,仅当所有属性都已冻结(或可能已冻结,以防为 @no_ 指定 true 时,才返回 trueisChecking).A typical implementation would call base, then call the static Freeze(Freezable, Boolean) method on all Freezable typed properties that the class contains, returning true only if all properties were frozen (or could have been frozen, in the case of specifying true for isChecking).