Inheritance: INotifyPropertyChanged
Exemplo n.º 1
0
        private void resetData()
        {
            do
            {
                _theThing = new TreeViewDataItem(DataTree.GetRandomDataTree(5, 5), "Children");
            }while (_theThing.Children.Count < 3);

            treeView.ItemsSource = _theThing.Children;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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 = new Random();
     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();
 }
Exemplo n.º 5
0
        private static object[] getRandomObjectPath(TreeViewDataItem thing)
        {
            List <TreeViewDataItem> path = new List <TreeViewDataItem>();
            Random rnd = new Random();

            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 = new Random();
     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();
 }
Exemplo n.º 7
0
        private static int[] getRandomIntPath(TreeViewDataItem thing)
        {
            List <int> path = new List <int>();
            Random     rnd  = new Random();

            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;
        }