Condition.Property Property


Gets or sets the property of the condition. This is only applicable to MultiTrigger objects.

 property System::Windows::DependencyProperty ^ Property { System::Windows::DependencyProperty ^ get(); void set(System::Windows::DependencyProperty ^ value); };
public System.Windows.DependencyProperty Property { get; set; }
member this.Property : System.Windows.DependencyProperty with get, set
Public Property Property As DependencyProperty

Property Value

A DependencyProperty that specifies the property of the condition. The default value is null.



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"/>


MultiTriggers allow you to set property values based on a set of conditions. A condition is satisfied when the value of the property (specified by the Property property) of the element matches the specified Value (reference equality check). If all specified conditions are satisfied, then the trigger is applied.

If TargetType is not set on the style of the template that contains the triggers. Then you need to qualify the property name using the ClassName.PropertyName syntax.

Note that if it is a condition for a MultiTrigger, the Property and Value properties must be set. Setting the Binding value would cause an exception in that case.

For Conditions in MultiDataTriggers, the Binding property should be used instead of this property.

Applies to

See also