ContextWindow: Change renew context event handling

This commit is contained in:
2023-09-18 21:46:14 +02:00
parent a6fef7fd9b
commit 3a73265a75
7 changed files with 44 additions and 32 deletions

View File

@ -52,8 +52,8 @@ namespace Elwig.Windows {
FillInputs(App.Client);
}
protected override async Task RenewContext() {
await base.RenewContext();
protected override async Task OnRenewContext() {
await base.OnRenewContext();
ControlUtils.RenewItemsSource(SeasonList, await Context.Seasons.OrderByDescending(s => s.Year).ToListAsync(), s => (s as Season)?.Year, null, ControlUtils.RenewSourceDefault.First);
var year = (SeasonList.SelectedItem as Season)?.Year;
ControlUtils.RenewItemsSource(SeasonModifierList, await Context.Modifiers.Where(m => m.Year == year).OrderBy(m => m.Ordering).ToListAsync(), m => (m as Modifier)?.ModId);