Xamarin.Forms Guides | Samples

Xamarin.Forms.PropertyCondition Class

Class that represents a value comparison against a property on the control that contains the enclosing MultiTrigger.

See Also: PropertyCondition


public sealed class PropertyCondition : Condition, IValueProvider

See Also


The PropertyCondition class is suitable for checking property values on the control that contains the MultiTrigger that contains it. To check values on other controls, developers can use the BindingCondition class, in addition to any property conditions in the trigger list.

The XML example below creates a property condition within a surrounding MultiTrigger within a TextCell that turns the text green when the secret is typed. The code is turned back to the default color if the user then edits the secret. (Typically, a MultiTrigger would have more than one condition; this example is simplified for clarity.)

XML Example

<Entry Placeholder="Type the secret!"
          <MultiTrigger TargetType="Entry" >
                  <PropertyCondition Property="Text"
                                     Value="The text color is green" />
              <Setter Property="TextColor"
                  Value="Color.Green" />


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,

The members of Xamarin.Forms.PropertyCondition are listed below.

See Also: Condition

Public Constructors

Initializes a new PropertyCondition instance.

Public Properties

PropertyBindableProperty. Gets or sets the property against which the PropertyCondition.Value property will be compared.
ValueObject. The binding value that satisfies the condition.

Explicitly Implemented Interface Members

PropertyCondition$IValueProvider.ProvideValue(IServiceProvider)For internal use by the Xamarin.Forms platform.