1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-10 21:33:36 +00:00

login page layout

This commit is contained in:
Kyle Spearrin
2019-05-01 15:11:54 -04:00
parent c8368a2190
commit 3b97fa0379
8 changed files with 170 additions and 85 deletions

View File

@@ -4,7 +4,6 @@ using Bit.Core.Abstractions;
using Bit.Core.Exceptions;
using Bit.Core.Utilities;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
namespace Bit.App.Pages
@@ -15,6 +14,8 @@ namespace Bit.App.Pages
private readonly IAuthService _authService;
private readonly ISyncService _syncService;
private bool _showPassword;
public LoginPageViewModel()
{
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
@@ -22,11 +23,21 @@ namespace Bit.App.Pages
_syncService = ServiceContainer.Resolve<ISyncService>("syncService");
PageTitle = AppResources.Bitwarden;
ShowPasswordCommand = new Command(() =>
Page.DisplayAlert("Button 1 Command", "Button 1 message", "Cancel"));
TogglePasswordCommand = new Command(TogglePassword);
}
public ICommand ShowPasswordCommand { get; }
public bool ShowPassword
{
get => _showPassword;
set => SetProperty(ref _showPassword, value,
additionalPropertyNames: new string[]
{
nameof(ShowPasswordIcon)
});
}
public Command TogglePasswordCommand { get; }
public string ShowPasswordIcon => ShowPassword ? "" : "";
public string Email { get; set; }
public string MasterPassword { get; set; }
@@ -74,5 +85,10 @@ namespace Bit.App.Pages
await Page.DisplayAlert(AppResources.AnErrorHasOccurred, e.Error.GetSingleMessage(), AppResources.Ok);
}
}
public void TogglePassword()
{
ShowPassword = !ShowPassword;
}
}
}