【发布时间】:2018-02-06 03:27:30
【问题描述】:
如果我将items 用作ItemsSource,它可以工作,但如果我使用sorted_items,它不会显示在列表视图中。
ObservableCollection<myModel> items = new ObservableCollection<myModel>();
ObservableCollection<myModel> sorted_items = new ObservableCollection<myModel>();
lv_items.ItemsSource = sorted_items;
items.Add(new myModel
{
ImageSource = myImage,
Name = item_name;
});
sorted_items = items;
for (int j = 0; j < sorted_items.Count; j++)
{
sorted_items.Move(sorted_items.Count - 1, j)
}
【问题讨论】:
-
这段代码甚至不会编译,因为你在声明它之前使用了
sorted_items。 -
我的错,我从头开始写的。无论如何,谢谢