Editare

Partajați prin


ValueSource.IsExpression Property

Definition

Gets a value that declares whether this value resulted from an evaluated expression. This might be a BindingExpression supporting a binding, or an internal expression such as those that support the DynamicResource Markup Extension.

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

Property Value

true if the value came from an evaluated expression; otherwise, false.

Remarks

An evaluated expression will also report the specific base value setting condition where the expression was applied, as a value in BaseValueSource. The BaseValueSource is still very relevant for any property where IsExpression is true. Knowing whether a value came through an expression can be particularly useful if the value was set indirectly, such as through a template or an inherited property value.

If an expression fails to evaluate (the binding failed; no resource of that name was found), then the value will come from some other participant in the property system, most likely the default value. That source is then reported in BaseValueSource. Failed expression evaluations will return false for IsExpression.

Applies to

See also