我有一个按以下方式设置的列表,我想以相反的顺序搜索和操作(删除项目),但我想不出一个好方法来做到这一点。
目前,该列表是一个Observable Collection
,但我可以将其更改为另一种类型。
我可以使用递归搜索列表,但我如何搜索(从孩子开始,然后向上)?
ID、ListOfChildren <>、姓名
例如:
ID: 1, ListOfChildren Count = 2, Name = "Room 1"<br>
--- ID 10, ListOfChildren, Count = 0, Name = "Bed 1.1"<br>
--- ID 11, ListOfChildren, Count = 0, Name = "Bed 1.2"<br>
ID: 2, ListOfChildren Count = 2, Name = "Room 2"<br>
--- ID 12, ListOfChildren, Count = 0, Name = "Bed 2.1"<br>
--- ID 13, ListOfChildren, Count = 0, Name = "Bed 2.2"<br>
ID: 3, ListOfChildren Count = 2, Name = "Room 3"<br>
--- ID 14, ListOfChildren, Count = 0, Name = "Bed 3.1"<br>
--- ID 15, ListOfChildren, Count = 0, Name = "Bed 3.2"<br>
谢谢,比尔