//------------------------------------------------------
        //
        //  Internal methods
        //
        //------------------------------------------------------

        internal void Add(object item)
        {
            if (_groupComparer == null)
            {
                ChangeCounts(item, +1);
                ProtectedItems.Add(item);
            }
            else
            {
                Insert(item, null, null);
            }
        }
        private void CollectionViewGroupProxy_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            var copy = _wrapped.Group.ToList();

            _dispatcher.Invoke(() =>
            {
                ProtectedItems.Clear();
                foreach (var item in copy)
                {
                    ProtectedItems.Add(item);
                }
                ProtectedItemCount = copy.Count;
            });
        }
        public CollectionViewGroupProxy(PersonAgeGroup group, Dispatcher dispatcher) : base(group.Key)
        {
            _wrapped    = group;
            _dispatcher = dispatcher;

            ((INotifyCollectionChanged)_wrapped.Group).CollectionChanged += CollectionViewGroupProxy_CollectionChanged;
            {
                foreach (var item in _wrapped.Group)
                {
                    ProtectedItems.Add(item);
                }
                ProtectedItemCount = group.Group.Count;
            }
        }
Ejemplo n.º 4
0
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        /// <summary>
        /// Adds the specified item to the collection
        /// </summary>
        /// <param name="item">Item to add</param>
        internal void Add(object item)
        {
            ChangeCounts(item, +1);
            ProtectedItems.Add(item);
        }
Ejemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 protected void AddItem(object item)
 {
     ProtectedItems.Add(item);
     ProtectedItemCount++;
 }