BaseDataWindow: Fix data renewal

This commit is contained in:
2024-03-30 08:49:11 +01:00
parent 1419c834ac
commit 1047bc6e8f
5 changed files with 33 additions and 9 deletions

@ -13,12 +13,18 @@ namespace Elwig.Windows {
private bool _seasonUpdate = false;
private async Task SeasonsInitEditing(AppDbContext ctx) {
ControlUtils.RenewItemsSource(SeasonList, await ctx.Seasons.Include(s => s.Modifiers).OrderByDescending(s => s.Year).ToListAsync());
ControlUtils.RenewItemsSource(SeasonList, await ctx.Seasons
.OrderByDescending(s => s.Year)
.Include(s => s.Modifiers)
.ToListAsync());
SeasonList_SelectionChanged(null, null);
}
private async Task SeasonsFinishEditing(AppDbContext ctx) {
ControlUtils.RenewItemsSource(SeasonList, await ctx.Seasons.Include(s => s.Modifiers).OrderByDescending(s => s.Year).ToListAsync());
ControlUtils.RenewItemsSource(SeasonList, await ctx.Seasons
.OrderByDescending(s => s.Year)
.Include(s => s.Modifiers)
.ToListAsync());
_seasonChanged = false;
}