PropertyCondition PropertyCondition Class

Definition

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

[Xamarin.Forms.Xaml.AcceptEmptyServiceProvider]
public sealed class PropertyCondition : Xamarin.Forms.Condition, Xamarin.Forms.Xaml.IValueProvider
type PropertyCondition = class
    inherit Condition
    interface IValueProvider
Inheritance
PropertyConditionPropertyCondition
Attributes
Implements

Remarks

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.)


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

Constructors

PropertyCondition() PropertyCondition()

Initializes a new PropertyCondition instance.

Properties

Property Property

Gets or sets the property against which the Value property will be compared.

Value Value

The binding value that satisfies the condition.

Explicit Interface Implementations

IValueProvider.ProvideValue(IServiceProvider) IValueProvider.ProvideValue(IServiceProvider)

For internal use by the Xamarin.Forms platform.

Extension Methods

LoadFromXaml<TXaml>(TXaml, String) LoadFromXaml<TXaml>(TXaml, String)

Returns an initialized view by loading the specified xaml.

LoadFromXaml<TXaml>(TXaml, Type) LoadFromXaml<TXaml>(TXaml, Type)

Returns a TXaml with the properties that are defined in the application manifest for callingType.

Applies to

See Also