【发布时间】:2016-11-21 15:11:29
【问题描述】:
我正在尝试更新 ListViewItem 中的文本,但找不到方法。
我修改了我使用的可观察集合,但 ListView 没有更新。我实现它的唯一方法是删除和添加相同的项目,但这会创建一个糟糕的动画(我删除了它,但它看起来也很糟糕)。
我的模特:
public class Feed : INotifyPropertyChanged
{
public int idfeed { get; set; }
public string message { get; set; }
public string comments { get; set; }
public string likes { get; set; }
public string timestamp { get; set; }
public string type { get; set; }
public string iLiked { get; set; }
public string next_id_comment { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
【问题讨论】:
-
任何示例代码都将有助于找出问题所在。但是,请确保您为尝试更新的模型属性实施了正确的绑定。
标签: c# listview windows-phone-8.1