add readonly password reveal

This commit is contained in:
TheXamlGuy
2024-07-06 17:01:50 +01:00
parent 0507c21a43
commit ee79b97416
18 changed files with 212 additions and 24 deletions
+21
View File
@@ -1,4 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Toolkit.Foundation;
namespace Wallet;
@@ -13,6 +14,8 @@ public partial class ItemEntryViewModel<TValue>(IServiceProvider provider,
ItemEntryConfiguration configuration,
string key,
TValue value,
bool isConcealed,
bool isRevealed,
double width) :
Observable<string, TValue>(provider, factory, mediator, publisher, subscriber, disposer, key, value),
IItemEntryViewModel,
@@ -21,6 +24,12 @@ public partial class ItemEntryViewModel<TValue>(IServiceProvider provider,
INotificationHandler<CancelEventArgs<Item>>
where TValue : notnull
{
[ObservableProperty]
private bool isConcealed = isConcealed;
[ObservableProperty]
private bool isRevealed = isRevealed;
[ObservableProperty]
private ItemState state = state;
@@ -48,4 +57,16 @@ public partial class ItemEntryViewModel<TValue>(IServiceProvider provider,
protected override void OnValueChanged() =>
configuration.Value = Value;
[RelayCommand]
private void Hide()
{
IsRevealed = false;
}
[RelayCommand]
private void Reveal()
{
IsRevealed = true;
}
}