/// <summary> /// 增加新卡 /// </summary> public void Add(datas card) { //如果datas里面有card,那么就抛出异常 if (ce.datas.FirstOrDefault(c => c.id == card.id) != null) throw new Exception("卡密重复"); ce.datas.Add(card); }
public void ScrollIntoView(datas d) { MessengerInstance.Send(new NotificationMessage<datas>(this,d,CardListNotificaions.ScrollTo)); }
/// <summary> /// 重新加载某个项 /// </summary> /// <param name="data"></param> public void Reload(datas data) { ce.Entry(data).Reload(); }
public void Replace(datas from, datas to) { Remove(from); Add(to); }
/// <summary> /// 删除卡片对象 /// </summary> public void Remove(datas card) { ce.datas.Remove(card); }