Validation work
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding !Active}"
|
||||
Spacing="12">
|
||||
<PersonPicture
|
||||
Width="144"
|
||||
Height="144"
|
||||
Margin="0,-144,0,0"
|
||||
DisplayName="{Binding Name}" />
|
||||
<TextBlock
|
||||
Text="{Binding Name}"
|
||||
@@ -28,5 +28,9 @@
|
||||
</KeyBindingTriggerBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<ProgressRing
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsActive="{Binding Active}" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet;
|
||||
@@ -22,12 +23,14 @@ public partial class OpenWalletViewModel(IServiceProvider provider,
|
||||
[RelayCommand]
|
||||
private async Task Invoke()
|
||||
{
|
||||
if (Password is { Length: > 0 })
|
||||
using (await new ActivityLock(this))
|
||||
{
|
||||
if (await Mediator.Handle<ActivateEventArgs<Wallet<string>>,
|
||||
bool>(Activate.As(new Wallet<string>(Password))))
|
||||
if (Password is { Length: > 0 })
|
||||
{
|
||||
Publisher.Publish(Opened.As<Wallet>());
|
||||
if (await Mediator.Handle<ActivateEventArgs<Wallet<string>>, bool>(Activate.As(new Wallet<string>(Password))))
|
||||
{
|
||||
Publisher.Publish(Opened.As<Wallet>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user