hi,
i have used the AppCompat to extended my material disign, i have extended entry(TextInputLayout).
but now my trigger applied to my xamarin forms entry , are not firing any more.
does any body have any idea how to solve this?
xaml code:
<Entry Text="{Binding Password.Value, Mode=TwoWay}" IsPassword="true" AutomationId="password" Placeholder="Password" PlaceholderColor="Black"> <Entry.Style> <OnPlatform x:TypeArguments="Style" iOS="{StaticResource EntryStyle}" Android="{StaticResource EntryStyle}" WinPhone="{StaticResource UwpEntryStyle}"/> </Entry.Style> <Entry.Behaviors> <behaviors:TurnValidOnFocusBehavior ValidityObject="{Binding Password}" /> </Entry.Behaviors> <Entry.Triggers> <DataTrigger TargetType="Entry" Binding="{Binding Password.IsValid}" Value="False"> <Setter Property="effects:LineColorEffect.LineColor" Value="{StaticResource ErrorColor}" /> </DataTrigger> </Entry.Triggers> </Entry>
Answers
Did you ever figure out a resolution for this?
Being able to update the on platform to the new format within the entry style seemed to resolve the issue for me. Maybe try replacing the style with the following?
<Entry.Style>
<OnPlatform x:TypeArguments="Style" >
<On Platform="Android" Value="{StaticResource EntryStyle}" />
<On Platform="iOS" Value="{StaticResource EntryStyle}" />
</OnPlatform>
</Entry.Style>
Since this is one of the top posts on google and describes what I was seeing. The reason the EntryStyle makes it "work" was because the Behavior needed ApplyLineColor set to true in order for it to work and the style had that set.
<Style x:Key="EntryStyle" TargetType="{x:Type Entry}">
<Setter Property="behaviors:LineColorBehavior.ApplyLineColor"
Value="True" />
</Style>