2 回答
TA贡献1815条经验 获得超10个赞
您遇到的问题是SetupCustomer,您没有清除列表,因此您的收藏中有多个条目。
private void SetupCustomer()
{
App.customers.Clear();
var customer = new Customer { FirstName = "Timothy", LastName = "Jennings", Email = "tim.jennings@gmail.com", Phone = "0275 202020",
Address = new Address { Street = "100 Burt Road", Suburb = "Howick", City = "Auckland", Country = "New Zealand" }
};
App.customers.Add(customer);
customer = new Customer { FirstName = "Brian", LastName = "Jones", Email = "bjones@gmail.com", Phone = "0275 903070",
Address = new Address { Street = "100 Vincent Road", Suburb = "St Lukes", City = "Auckland", Country = "New Zealand" }
};
App.customers.Add(customer);
App.customers.Add(new Customer { FirstName = "Terry", LastName = "Teo", Email = "tete@mana.com", Phone = "021 756 382",
Address = new Address { Street = "23 Ford St", City = "Auckland", Suburb = "Pakuranga", Country = "New Zealand" }
});
}
TA贡献1783条经验 获得超4个赞
在您SetupCustomer
的课堂方法中,AddCustomerUI
在开始时添加
App.customers.Clear();
这应该有助于您的重复数据。
- 2 回答
- 0 关注
- 204 浏览
添加回答
举报