Change episode default sorting to SeriesOrder descending

This commit is contained in:
Mbucari 2023-04-10 15:50:19 -06:00
parent 8a1b375f0d
commit af8e1cd5ef
8 changed files with 26 additions and 23 deletions

View file

@ -16,11 +16,13 @@ namespace LibationAvalonia.ViewModels
public RowComparer(DataGridColumn column)
{
Column = column;
PropertyName = Column.SortMemberPath;
PropertyName = Column?.SortMemberPath ?? nameof(IGridEntry.DateAdded);
}
//Avalonia doesn't expose the column's CurrentSortingState, so we must get it through reflection
protected override ListSortDirection? GetSortOrder()
=> CurrentSortingStatePi.GetValue(HeaderCellPi.GetValue(Column)) as ListSortDirection?;
protected override ListSortDirection GetSortOrder()
=> Column is null ? ListSortDirection.Descending
: CurrentSortingStatePi.GetValue(HeaderCellPi.GetValue(Column)) is ListSortDirection lsd ? lsd
: ListSortDirection.Descending;
}
}