Ejemplo n.º 1
0
        public BaseTreeItem(string title, IFlatListItem parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            Title = title;
            AttachTo(parent);
        }
Ejemplo n.º 2
0
        private static void AddItemsTo(BindableCollection <Node> newParentCollection, IFlatListItem insertPlace, IEnumerable <Node> items)
        {
            var newItems = new List <Node>();
            var position = newParentCollection.IndexOf(insertPlace as Node);

            if (position != -1)
            {
                newItems.AddRange(newParentCollection.Take(position));
                newItems.AddRange(items);
                newItems.AddRange(newParentCollection.Skip(position));
            }
            else
            {
                newItems.AddRange(newParentCollection);
                newItems.AddRange(items);
            }
            newParentCollection.IsNotifying = false;
            newParentCollection.Clear();
            newParentCollection.AddRange(newItems);
            newParentCollection.IsNotifying = true;
            newParentCollection.Refresh();
        }
Ejemplo n.º 3
0
 public CompositeViewModel(string title, IFlatListItem parent)
     : base(title, parent)
 {
     SubItems.CollectionChanged += CollectionChangedHandler;
 }
Ejemplo n.º 4
0
 public void AttachTo(IFlatListItem parent)
 {
     Parent     = parent;
     LeftMargin = parent == null ? 0 : parent.SizeWidth;
 }
Ejemplo n.º 5
0
 public LeafViewModel(string title, IFlatListItem parent)
     : base(title, parent)
 {
 }