26 lines
602 B
C#
26 lines
602 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.Threading;
|
|
|
|
namespace EinmaleinsTrainer.Views;
|
|
|
|
public partial class QuizView : UserControl
|
|
{
|
|
public QuizView()
|
|
{
|
|
InitializeComponent();
|
|
|
|
this.AttachedToVisualTree += async (_,_) =>
|
|
{
|
|
await Dispatcher.UIThread.InvokeAsync(() => { }, DispatcherPriority.Background);
|
|
|
|
var tb = this.FindControl<TextBox>("AnswerTextBox");
|
|
tb?.Focus();
|
|
};
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
} |