|
|
|
@ -5,9 +5,20 @@ namespace ShoopNCook.Pages;
|
|
|
|
|
public partial class RegisterPage : ContentPage
|
|
|
|
|
{
|
|
|
|
|
private readonly RegisterController controller;
|
|
|
|
|
|
|
|
|
|
private readonly BindableProperty PasswordHideProperty = BindableProperty.Create(nameof(PasswordHide), typeof(bool), typeof(LoginPage), false);
|
|
|
|
|
public bool PasswordHide
|
|
|
|
|
{
|
|
|
|
|
get => (bool)GetValue(PasswordHideProperty);
|
|
|
|
|
private set => SetValue(PasswordHideProperty, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public RegisterPage(RegisterController controller)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
BindingContext = this;
|
|
|
|
|
SetPasswordHide(true);
|
|
|
|
|
this.controller = controller;
|
|
|
|
|
}
|
|
|
|
|
private async void LoginTapped(object sender, EventArgs e)
|
|
|
|
@ -21,4 +32,19 @@ public partial class RegisterPage : ContentPage
|
|
|
|
|
string username = UserNameEntry.Text;
|
|
|
|
|
controller.Register(username, email, password);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnPasswordRevealClicked(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SetPasswordHide(!PasswordHide);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetPasswordHide(bool shown)
|
|
|
|
|
{
|
|
|
|
|
PasswordHide = shown;
|
|
|
|
|
|
|
|
|
|
if (shown)
|
|
|
|
|
PasswordReveal.Source = ImageSource.FromFile("visibility_off.svg");
|
|
|
|
|
else
|
|
|
|
|
PasswordReveal.Source = ImageSource.FromFile("visibility_on.svg");
|
|
|
|
|
}
|
|
|
|
|
}
|