sharee.bike-App/SharedGui/View/TogglePasswordEntry.xaml
2024-04-09 12:53:23 +02:00

45 lines
1.6 KiB
XML

<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SharedGui.View.TogglePasswordEntry"
xmlns:resources="clr-namespace:ShareeBike.MultilingualResources;assembly=SharedBusinessLogic"
x:Name="root">
<ContentView.Content>
<Grid BindingContext="{x:Reference root}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<Entry Placeholder="{Binding Placeholder}"
IsPassword="{Binding HidePassword}"
Text="{Binding Text}"/>
<ImageButton Clicked="OnImageButtonClicked"
BackgroundColor="Transparent"
Grid.Column="1">
<ImageButton.Triggers>
<DataTrigger TargetType="ImageButton"
Binding="{Binding HidePassword}"
Value="True">
<Setter Property="Source">
<Setter.Value>
<FontImageSource Glyph="{StaticResource EyeOpen}"
Color="{Binding HidePasswordColor}"
FontFamily="FA-S" />
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger TargetType="ImageButton"
Binding="{Binding HidePassword}"
Value="False">
<Setter Property="Source">
<Setter.Value>
<FontImageSource Glyph="{StaticResource EyeClose}"
Color="{Binding HidePasswordColor}"
FontFamily="FA-S" />
</Setter.Value>
</Setter>
</DataTrigger>
</ImageButton.Triggers>
</ImageButton>
</Grid>
</ContentView.Content>
</ContentView>