[] App: Use FileSystemWatcher to renew contexts on demand

This commit is contained in:
2024-03-19 13:17:06 +01:00
parent 98688168b8
commit 1806b02039
13 changed files with 51 additions and 66 deletions

@ -264,9 +264,8 @@ namespace Elwig.Windows {
ValidateRequiredInputs();
}
protected override async Task OnRenewContext() {
await base.OnRenewContext();
using var ctx = new AppDbContext();
protected override async Task OnRenewContext(AppDbContext ctx) {
await base.OnRenewContext(ctx);
ControlUtils.RenewItemsSource(BranchInput, await ctx.Branches.OrderBy(b => b.Name).ToListAsync());
ControlUtils.RenewItemsSource(DefaultKgInput, await ctx.WbKgs.Select(k => k.AtKg).OrderBy(k => k.Name).ToListAsync());
await RefreshMemberList();