feat(ui): complete Avalonia UI port with 7 main pages, tool settings & top MenuBar

This commit is contained in:
Richard
2026-08-10 10:48:34 +02:00
parent a0e18d2a57
commit b5bf97ae74
187 changed files with 20054 additions and 882 deletions
@@ -0,0 +1,46 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
namespace ClawdDotNet.Desktop.ViewModels;
/// <summary>Eingabe eines Lizenzschlüssels. Siehe <c>AvaloniaLicensePrompt</c>.</summary>
public sealed partial class LicenseViewModel : ViewModelBase
{
private readonly TaskCompletionSource<string?> _completion = new();
[ObservableProperty]
private string _key;
public string HardwareId { get; }
/// <summary>Warum der bisherige Schlüssel nicht taugt; leer beim ersten Fragen.</summary>
public string Problem { get; }
/// <summary>Der eingegebene Schlüssel, oder <c>null</c> bei Abbruch.</summary>
public Task<string?> Result => _completion.Task;
public LicenseViewModel(string hardwareId, string? problem, string? currentKey)
{
HardwareId = hardwareId;
Problem = problem ?? "";
_key = currentKey ?? "";
}
[RelayCommand]
private void Confirm()
{
var value = Key.Trim();
// Leere Eingabe ist kein Abbruch — sonst schließt sich das Fenster, wenn jemand
// versehentlich die Eingabetaste drückt.
if (value.Length == 0) return;
_completion.TrySetResult(value);
}
[RelayCommand]
private void Cancel() => _completion.TrySetResult(null);
/// <summary>Schließt der Benutzer das Fenster, gilt das als Abbruch.</summary>
public void CancelIfPending() => _completion.TrySetResult(null);
}