ValueSource.IsCoerced 属性

定义

获取一个值,声明此值是否是从应用于依赖属性的 CoerceValueCallback 实现中生成的。Gets a value that declares whether this value resulted from a CoerceValueCallback implementation applied to a dependency property.

public:
 property bool IsCoerced { bool get(); };
public bool IsCoerced { get; }
member this.IsCoerced : bool
Public ReadOnly Property IsCoerced As Boolean

属性值

如果此值是从应用于依赖项属性的 CoerceValueCallback 实现中生成的,则为 true;否则为 falsetrue if the value resulted from a CoerceValueCallback implementation applied to a dependency property; otherwise, false.

注解

如果强制在属性值上操作, 属性将保留一个所需值, 如果更改或提升了特定强制的约束, 则属性值将尝试访问该所需的值。If coercion is acting on a property value, the property retains a desired value, and the property value will attempt to reach that desired value if the constraints of the specific coercion are changed or lifted. 不在其所需值的已强制属性将报告IsCoerced为。 trueA coerced property that is not at its desired value will report that IsCoerced is true.

强制的优先级高于基值, 并不严格地与基值的设置方式有关。Coercion acts at higher precedence than the base value, and is not strictly speaking a participant in how the base value is set. 因此, 被强制的状态由此属性而不是BaseValueSource枚举的值报告。Therefore the state of being coerced is reported by this property, rather than by a value of the BaseValueSource enumeration. 有关强制、基值和优先级的详细信息, 请参阅依赖属性值优先级For more information about coercion, base values, and precedence, see Dependency Property Value Precedence.

适用于

另请参阅