Condition.Value Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the value of the condition.

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

Public Property Value As Object

Property Value

Type: System.Object

The Value property cannot be null for a given Condition.

See also the Exceptions section. The default value is null.

Exception Condition

MarkupExtensions are not supported.


Expressions are not supported.

MultiTriggers and MultiDataTriggers allow you to set property values based on a set of conditions. A condition is satisfied when the property value of the element or data item matches the specified Value. If all specified conditions are satisfied, then the trigger is applied. If all specified conditions are satisfied, then the trigger is applied.

The following example contains two MultiTriggers. The first sets the MinWidth property value when the HasItems property is false and the Width property is Auto. The second one is similar but is for the MinHeight property.

  <Trigger Property="IsEnabled" Value="false">
    <Setter Property="Background" Value="#EEEEEE" />

      <Condition Property="HasItems" Value="false" />
      <Condition Property="Width" Value="Auto" />
    <Setter Property="MinWidth" Value="120"/>

      <Condition Property="HasItems" Value="false" />
      <Condition Property="Height" Value="Auto" />
    <Setter Property="MinHeight" Value="95"/>

See the Binding property for examples of conditions used in a MultiDataTrigger.

.NET Framework
Available since 3.0
Return to top