public void Remove() { App.db.Remove(selectedItem); if (selectedItem != null) { this.allItems.Remove(selectedItem); } selectedItem = null; }
public void Update(Model.Class1 a) { if (selectedItem != null) { a.id = selectedItem.id; App.db.Update(a); this.selectedItem.Update(a.title, a.detail, a.date, a.size, a.picPath, a.pic, a.ischecked); } this.selectedItem = null; }
public ItemViewModel() { this.allItems = new ObservableCollection <Model.Class1> { }; selectedItem = null; }
public void AddItem(Model.Class1 a) { this.allItems.Add(a); this.selectedItem = null; }
public void AddItem(string title, string detail, DateTimeOffset date, double size, string picPath = "Assets/document.jpg", BitmapImage pic = null, bool?ischecked = false) { Model.Class1 a = new Model.Class1(title, detail, date, size, picPath, pic, ischecked); this.allItems.Add(a); this.selectedItem = null; }