private static void AppendDemoItems(ObservableCollection <object> root) { foreach (var i in DemoItem.CreateItems(2, null, root.Count)) { root.Add(i); } }
private static void AppendFirstContent(ObservableCollection <object> root) { var firstItem = root[0] as DemoItem; if (firstItem == null) { root[0] = firstItem = new DemoItem { Label = "1" } } ; foreach (var childItem in DemoItem.CreateItems(1, firstItem, seed: 3, labelIndex: firstItem.Children.Count)) { firstItem.Children.Add(childItem); } }
private void ResetContent(object sender, RoutedEventArgs e) { ++_contentGeneration; DemoItem.Root = DemoItem.CreateItems(2, null, _contentGeneration); DemoItem.Root2 = DemoItem.CreateItems(2, null, _contentGeneration); }