在我的ViewModel名單上手動調用的PropertyChanged我有一個屬性,它是模型列表:車型
private List<LocationModel> _locations = null;
public List<LocationModel> Locations
{
get
{
return this._locations;
}
set
{
this._locations = value;
RaisePropertyChanged("Locations");
}
}
但LocationModel
類未實現INotifyPropertyChanged
,所以當我更新的屬性列表中的項目,UI不會更新。我嘗試通過在更改列表項後手動提高事件來實現此目的,但這不起作用。有人可以解釋爲什麼這種方法不起作用?
在此先感謝。
我剛剛注意到你在另一個回覆的評論中提到了關於「純粹模型」的內容。我完全同意。但我從不向接口公開一個模型,我只公開ViewModels。你的LocationViewModel在哪裏? – Tewr