ControlUtils: Cleanup SelectItem() method and use accordingly
This commit is contained in:
@ -22,12 +22,12 @@ namespace Elwig.Windows {
|
||||
_attrList = new(await ctx.WineAttributes.OrderBy(a => a.Name).ToListAsync());
|
||||
_attrs = _attrList.ToDictionary(a => a.AttrId, a => (string?)a.AttrId);
|
||||
_attrIds = _attrList.ToDictionary(a => a, a => a.AttrId);
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, _attrList, a => (a as WineAttr)?.AttrId);
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, _attrList);
|
||||
WineAttributeList_SelectionChanged(null, null);
|
||||
}
|
||||
|
||||
private async Task WineAttributesFinishEditing(AppDbContext ctx) {
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, await ctx.WineAttributes.OrderBy(a => a.Name).ToListAsync(), a => (a as WineAttr)?.AttrId);
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, await ctx.WineAttributes.OrderBy(a => a.Name).ToListAsync());
|
||||
_attrList = null;
|
||||
_attrs = null;
|
||||
_attrIds = null;
|
||||
|
Reference in New Issue
Block a user