ContextWindow: Use Task.Run to load data outside main thread
All checks were successful
Test / Run tests (push) Successful in 2m29s

This commit is contained in:
2026-04-02 14:18:06 +02:00
parent 1f4fe2129d
commit e593175e72
18 changed files with 241 additions and 186 deletions

View File

@@ -40,8 +40,11 @@ namespace Elwig.Windows {
}
protected async void OnLoaded(object? sender, RoutedEventArgs? evt) {
Mouse.OverrideCursor = Cursors.AppStarting;
using var ctx = new AppDbContext();
await OnRenewContext(ctx);
await OnInit(ctx);
Mouse.OverrideCursor = null;
}
protected async Task EnsureContextRenewed() {
@@ -51,6 +54,8 @@ namespace Elwig.Windows {
_renewPending = false;
}
virtual protected async Task OnInit(AppDbContext ctx) { }
abstract protected Task OnRenewContext(AppDbContext ctx);
}
}