private void Sort()
{
var list = _children.OfType<BoxTreeViewModel>().ToList();
list.Sort((x, y) =>
{
int c = x.Value.Name.CompareTo(y.Value.Name);
if (c != 0) return c;
c = y.Value.Seeds.Count.CompareTo(x.Value.Seeds.Count);
if (c != 0) return c;
c = y.Value.Boxes.Count.CompareTo(x.Value.Boxes.Count);
if (c != 0) return c;
return x.GetHashCode().CompareTo(y.GetHashCode());
});
for (int i = 0; i < list.Count; i++)
{
var o = _children.IndexOf(list[i]);
if (i != o) _children.Move(o, i);
}
}