有人可以告诉我这里我做错了什么 - 刚开始学习WPF - 代码对初始绑定进行排序但之后不起作用吗?
private void SortSeriesList(string sortDirection) {
ListBoxSeries.Items.SortDescriptions.Clear();
switch (sortDirection) {
case "asc":
ListBoxSeries.Items.SortDescriptions.Add(new System.ComponentModel.SortDescription("SeriesName", System.ComponentModel.ListSortDirection.Ascending));
break;
case "desc":
ListBoxSeries.Items.SortDescriptions.Add(new System.ComponentModel.SortDescription("SeriesName", System.ComponentModel.ListSortDirection.Descending));
break;
}
}