Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Binding a Data Trigger

$
0
0

Hi guys,
I have a XAML page with a label which Text property is binding with a ViewModel property named SALDO.
I want to see the label's TextColor Red when the value from SALDO is <0.
I have tried this, there is no compilation error, but the TextColor never change.

    <Label
      Style="{StaticResource TextoGeneral}"
      Text="{Binding Saldo, StringFormat='{0:C0}'}">
      <Label.Triggers>
        <DataTrigger TargetType="Label"
                     Binding="{Binding Saldo}"
                     Value="<0">
          <Setter Property="TextColor" Value="Red" />
        </DataTrigger>
      </Label.Triggers>
    </Label>

Any idea?
Tanks


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>