private void resetData() { do { _theThing = new TreeViewDataItem(DataTree.GetRandomDataTree(5, 5), "Children"); }while (_theThing.Children.Count < 3); treeView.ItemsSource = _theThing.Children; }
internal TreeViewDataItem(object dataItem, string childrenPropertyName, TreeViewDataItem parent) { if (dataItem == null) { throw new ArgumentNullException("dataItem"); } if (childrenPropertyName == null) { throw new ArgumentNullException("childrenPropertyName"); } _dataItem = dataItem; _childrenPropertyName = childrenPropertyName; _parent = parent; }
private static object[] getRandomObjectPath(TreeViewDataItem thing) { List<TreeViewDataItem> path = new List<TreeViewDataItem>(); Random rnd = Util.Rnd; while (thing != null) { if (thing.Children.Count > 0) { thing = thing.Children[rnd.Next(thing.Children.Count)]; path.Add(thing); } else { thing = null; } } return path.ToArray(); }
private static int[] getRandomIntPath(TreeViewDataItem thing) { List<int> path = new List<int>(); Random rnd = Util.Rnd; while (thing != null) { if (thing.Children.Count > 0) { int index = rnd.Next(thing.Children.Count); thing = thing.Children[index]; path.Add(index); } else { thing = null; } } return path.ToArray(); }
private static object[] getRandomObjectPath(TreeViewDataItem thing) { List <TreeViewDataItem> path = new List <TreeViewDataItem>(); Random rnd = Util.Rnd; while (thing != null) { if (thing.Children.Count > 0) { thing = thing.Children[rnd.Next(thing.Children.Count)]; path.Add(thing); } else { thing = null; } } return(path.ToArray()); }
private static int[] getRandomIntPath(TreeViewDataItem thing) { List <int> path = new List <int>(); Random rnd = Util.Rnd; while (thing != null) { if (thing.Children.Count > 0) { int index = rnd.Next(thing.Children.Count); thing = thing.Children[index]; path.Add(index); } else { thing = null; } } return(path.ToArray()); }
private void resetData() { do { _theThing = new TreeViewDataItem(DataTree.GetRandomDataTree(5, 5), "Children"); } while (_theThing.Children.Count < 3); treeView.ItemsSource = _theThing.Children; }