Export (0) Print
Expand All

ValueSource.IsExpression Property

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.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public bool IsExpression { get; }

Property Value

Type: System.Boolean
true if the value came from an evaluated expression; otherwise, false.

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft