C# ObservableCollection和LongListSelector

C# ObservableCollection和LongListSelector,c#,data-binding,C#,Data Binding,我的应用程序包括在五页之间导航。每一页都包含一个列表。所有列表都使用LongListSelector和绑定ObservableCollection显示等效内容: public class ItemViewModel : INotifyPropertyChanged { ... } public class MainViewModel : INotifyPropertyChanged { ... public ObservableCollection<ItemView

我的应用程序包括在五页之间导航。每一页都包含一个列表。所有列表都使用LongListSelector和绑定ObservableCollection显示等效内容:

public class ItemViewModel : INotifyPropertyChanged
{
    ...
}
public class MainViewModel : INotifyPropertyChanged
{
    ...
    public ObservableCollection<ItemViewModel> Items { get; private set; }
    ...
}
我试图实现EventCollectionChanged,但它什么也没改变


使用它的方式是否错误?是否有其他方法可以在同一页面中绑定多组数据?

当您更改
属性时,您没有引发
属性更改
事件。添加一个备份字段并在属性设置器中执行,或者在分配
项后直接启动它。例如

this.Items = this.ItemsList;
RaisePropertyChanged("Items"); //or however you've implemented INPC

我们需要更多的代码来发现问题,我添加了这个。NotifyPropertyChanged(“Items”),它可以正常工作。谢谢
this.Items = this.ItemsList;
RaisePropertyChanged("Items"); //or however you've implemented INPC