Sort episodes by column beneath their parents
This commit is contained in:
parent
69918c2587
commit
2248d7b24e
@ -70,9 +70,9 @@ namespace LibationAvalonia.ViewModels
|
|||||||
return InternalCompare(parentA, geB);
|
return InternalCompare(parentA, geB);
|
||||||
}
|
}
|
||||||
|
|
||||||
//both are children of the same series, always present in order of series index, ascending
|
//both are children of the same series
|
||||||
if (parentA == parentB)
|
if (parentA == parentB)
|
||||||
return geA.SeriesIndex.CompareTo(geB.SeriesIndex) * (sortDirection is ListSortDirection.Ascending ? 1 : -1);
|
return InternalCompare(geA, geB);
|
||||||
|
|
||||||
//a and b are children of different series.
|
//a and b are children of different series.
|
||||||
return InternalCompare(parentA, parentB);
|
return InternalCompare(parentA, parentB);
|
||||||
|
|||||||
@ -201,8 +201,8 @@ namespace LibationWinForms.GridView
|
|||||||
{
|
{
|
||||||
var pIndex = itemsList.IndexOf(parent);
|
var pIndex = itemsList.IndexOf(parent);
|
||||||
|
|
||||||
//children should always be sorted by series index.
|
//children are sorted beneath their series parent
|
||||||
foreach (var c in children.Where(c => c.Parent == parent).OrderBy(c => c.SeriesIndex))
|
foreach (var c in children.Where(c => c.Parent == parent).OrderBy(c => c, Comparer))
|
||||||
itemsList.Insert(++pIndex, c);
|
itemsList.Insert(++pIndex, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user