0
저는 SqlCe 데이터베이스에 데이터를 쓰는 망고 앱을 만들고 있습니다. 나는 데이터베이스에 추가 될 때 항목을 표시해야하는 DataSource
에 바인딩 된 ListBox
을 가지고 있지만 데이터를 추가/업데이트 할 때 업데이트를 얻을 수 없으며 페이지를 다시로드 할 때만 표시됩니다. 나는 시간 테이블에 데이터를 추가 할 때NotifyPropertyChanged 컬렉션에서 데이터 업데이트를 가져올 수 없습니다.
public class TimeTrackerViewModel: INotifyPropertyChanged, INotifyPropertyChanging
{
private List<TimeItems> _timeItems;
public List<TimeItems> TimeItems
{
get { return _timeItems; }
set
{
NotifyPropertyChanging("TimeItems");
_timeItems = value;
NotifyPropertyChanged("TimeItems");
}
}
public void LoadCollectionsFromDatabase()
{
// Specify the query for all to-do items in the database.
var times = from t in db.Times
select new TimeItems
{
DtIn = t.DtIn,
DtOut = t.DtOut,
Id = t.Id
};
// Query the database and load all to-do items.
TimeItems = new List<TimeItems>(times);
}
.....
.....
}
내가 TimeItems
컬렉션에 바인딩 된 목록 상자에 DB 업데이트를 볼 수 없습니다 : 는 여기에 몇 가지 조각입니다. 내가 뭘 잘못하고 있니?