Skip to content

Instantly share code, notes, and snippets.

@joshayoung
Created July 19, 2021 22:37
Show Gist options
  • Select an option

  • Save joshayoung/c512b2d10e34d4935b1f24d3cd681b39 to your computer and use it in GitHub Desktop.

Select an option

Save joshayoung/c512b2d10e34d4935b1f24d3cd681b39 to your computer and use it in GitHub Desktop.

Revisions

  1. Josh Young created this gist Jul 19, 2021.
    16 changes: 16 additions & 0 deletions DataTrigger.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    <Entry Placeholder="First Name" x:Name="firstName" />
    <Entry
    BackgroundColor="LightGray"
    IsEnabled="False"
    Placeholder="Last Name">
    <Entry.Triggers>
    <!-- Enabled this field after 'firstName' is longer than three characters -->
    <DataTrigger
    Binding="{Binding Source={x:Reference firstName}, Path=Text.Length}"
    TargetType="Entry"
    Value="3">
    <Setter Property="BackgroundColor" Value="White" />
    <Setter Property="IsEnabled" Value="True" />
    </DataTrigger>
    </Entry.Triggers>
    </Entry>