feat: rename to PinCode, add styles for size.

This commit is contained in:
rabbitism
2024-07-31 14:11:16 +08:00
parent 16e68061d1
commit ff666cafdc
17 changed files with 149 additions and 94 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Ursa.Controls;
namespace Ursa.Demo.ViewModels;
public partial class PinCodeDemoViewModel: ObservableObject
{
public ICommand CompleteCommand { get; set; }
[ObservableProperty] private List<Exception>? _error;
public PinCodeDemoViewModel()
{
CompleteCommand = new AsyncRelayCommand<IList<string>>(OnComplete);
Error = [new Exception("Invalid verification code")];
}
private async Task OnComplete(IList<string>? obj)
{
if (obj is null) return;
var code = string.Join("", obj);
await MessageBox.ShowOverlayAsync(code);
}
}