mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-19 11:37:28 +02:00
Version 3.0.350
This commit is contained in:
parent
7f49fb0ac5
commit
40b96f0350
70 changed files with 12021 additions and 8388 deletions
45
ShareeSharedGuiLib/View/TogglePasswordEntry.xaml
Normal file
45
ShareeSharedGuiLib/View/TogglePasswordEntry.xaml
Normal file
|
@ -0,0 +1,45 @@
|
|||
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="ShareeSharedGuiLib.View.TogglePasswordEntry"
|
||||
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
|
||||
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>
|
65
ShareeSharedGuiLib/View/TogglePasswordEntry.xaml.cs
Normal file
65
ShareeSharedGuiLib/View/TogglePasswordEntry.xaml.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace ShareeSharedGuiLib.View
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class TogglePasswordEntry : ContentView
|
||||
{
|
||||
|
||||
public static readonly BindableProperty PlaceholderProperty =
|
||||
BindableProperty.Create(nameof(Placeholder), typeof(string), typeof(TogglePasswordEntry));
|
||||
|
||||
public static readonly BindableProperty TextProperty =
|
||||
BindableProperty.Create(nameof(Text), typeof(string), typeof(TogglePasswordEntry),
|
||||
defaultBindingMode: BindingMode.TwoWay);
|
||||
|
||||
public static readonly BindableProperty HidePasswordProperty =
|
||||
BindableProperty.Create(nameof(HidePassword), typeof(bool), typeof(TogglePasswordEntry),
|
||||
defaultValue: true);
|
||||
|
||||
public static readonly BindableProperty HidePasswordColorProperty =
|
||||
BindableProperty.Create(nameof(HidePasswordColor), typeof(Color), typeof(TogglePasswordEntry),
|
||||
defaultValue: Color.DimGray);
|
||||
|
||||
public string Placeholder
|
||||
{
|
||||
get => (string)GetValue(PlaceholderProperty);
|
||||
set => SetValue(PlaceholderProperty, value);
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => (string)GetValue(TextProperty);
|
||||
set => SetValue(TextProperty, value);
|
||||
}
|
||||
|
||||
public bool HidePassword
|
||||
{
|
||||
get => (bool)GetValue(HidePasswordProperty);
|
||||
set => SetValue(HidePasswordProperty, value);
|
||||
}
|
||||
|
||||
public Color HidePasswordColor
|
||||
{
|
||||
get => (Color)GetValue(HidePasswordColorProperty);
|
||||
set => SetValue(HidePasswordColorProperty, value);
|
||||
}
|
||||
|
||||
public TogglePasswordEntry()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnImageButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
HidePassword = !HidePassword;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue