void AddCellItem(ChatSubItem item) { ChatCellItem cellitem; for (int i = 0; i < 5; i++) { cellitem = new ChatCellItem() { Text = "Cell item " + i, }; item.SubItems.Add(cellitem); } }
void AddSubItem(ChatItem item) { ChatSubItem subitem; for (int i = 0; i < 5; i++) { subitem = new ChatSubItem() { Text = "Sub Item " + i, }; if (i % 2 == 0) { subitem.IsOpen = true; } AddCellItem(subitem); item.Items.Add(subitem); } }