mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Update credentials better looking
This commit is contained in:
@@ -2,6 +2,6 @@
|
||||
{
|
||||
public class SaveErrorMessage
|
||||
{
|
||||
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
@@ -19,6 +19,7 @@ namespace ModernKeePass.ViewModels
|
||||
set
|
||||
{
|
||||
Set(() => HasPassword, ref _hasPassword, value);
|
||||
RaisePropertyChanged(nameof(IsPasswordValid));
|
||||
RaisePropertyChanged(nameof(IsValid));
|
||||
GenerateCredentialsCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
@@ -30,23 +31,19 @@ namespace ModernKeePass.ViewModels
|
||||
set
|
||||
{
|
||||
Set(() => HasKeyFile, ref _hasKeyFile, value);
|
||||
RaisePropertyChanged(nameof(IsKeyFileValid));
|
||||
RaisePropertyChanged(nameof(IsValid));
|
||||
GenerateCredentialsCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Status
|
||||
{
|
||||
get { return _status; }
|
||||
set { Set(() => Status, ref _status, value); }
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get { return _password; }
|
||||
set
|
||||
{
|
||||
_password = value;
|
||||
RaisePropertyChanged(nameof(IsPasswordValid));
|
||||
RaisePropertyChanged(nameof(IsValid));
|
||||
RaisePropertyChanged(nameof(PasswordComplexityIndicator));
|
||||
GenerateCredentialsCommand.RaiseCanExecuteChanged();
|
||||
@@ -58,6 +55,7 @@ namespace ModernKeePass.ViewModels
|
||||
set
|
||||
{
|
||||
_confirmPassword = value;
|
||||
RaisePropertyChanged(nameof(IsPasswordValid));
|
||||
RaisePropertyChanged(nameof(IsValid));
|
||||
GenerateCredentialsCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
@@ -69,6 +67,7 @@ namespace ModernKeePass.ViewModels
|
||||
set
|
||||
{
|
||||
_keyFilePath = value;
|
||||
RaisePropertyChanged(nameof(IsKeyFileValid));
|
||||
RaisePropertyChanged(nameof(IsValid));
|
||||
GenerateCredentialsCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
@@ -79,27 +78,21 @@ namespace ModernKeePass.ViewModels
|
||||
get { return _keyFileText; }
|
||||
set { Set(() => KeyFileText, ref _keyFileText, value); }
|
||||
}
|
||||
|
||||
public string OpenButtonLabel
|
||||
{
|
||||
get { return _openButtonLabel; }
|
||||
set { Set(() => OpenButtonLabel, ref _openButtonLabel, value); }
|
||||
}
|
||||
|
||||
|
||||
public double PasswordComplexityIndicator => _credentials.EstimatePasswordComplexity(Password);
|
||||
|
||||
public bool IsValid => HasPassword && Password == ConfirmPassword || HasKeyFile && !string.IsNullOrEmpty(KeyFilePath);
|
||||
public bool IsPasswordValid => HasPassword && Password == ConfirmPassword || !HasPassword;
|
||||
public bool IsKeyFileValid => HasKeyFile && !string.IsNullOrEmpty(KeyFilePath) || !HasKeyFile;
|
||||
public bool IsValid => (IsPasswordValid || IsKeyFileValid) && (HasPassword || HasKeyFile);
|
||||
|
||||
public RelayCommand GenerateCredentialsCommand{ get; }
|
||||
|
||||
private bool _hasPassword;
|
||||
private bool _hasKeyFile;
|
||||
private string _password = string.Empty;
|
||||
private string _confirmPassword;
|
||||
private string _status;
|
||||
private string _confirmPassword = string.Empty;
|
||||
private string _keyFilePath;
|
||||
private string _keyFileText;
|
||||
private string _openButtonLabel;
|
||||
|
||||
public SetCredentialsVm(IMediator mediator, ICredentialsProxy credentials, IResourceProxy resource)
|
||||
{
|
||||
|
Reference in New Issue
Block a user