mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
28 lines
687 B
C#
28 lines
687 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Markup.Xaml;
|
|
|
|
namespace LanMountainDesktop.Launcher.Views;
|
|
|
|
internal partial class OobeWindow : Window
|
|
{
|
|
private readonly TaskCompletionSource<bool> _completionSource = new();
|
|
|
|
public OobeWindow()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
var enterButton = this.FindControl<Button>("EnterButton");
|
|
if (enterButton is not null)
|
|
{
|
|
enterButton.Click += OnEnterClick;
|
|
}
|
|
}
|
|
|
|
public Task WaitForEnterAsync() => _completionSource.Task;
|
|
|
|
private void OnEnterClick(object? sender, RoutedEventArgs e)
|
|
{
|
|
_completionSource.TrySetResult(true);
|
|
}
|
|
}
|