Пример #1
0
        private ViewRecord CreateAndCacheNewView(object collection, Appercode.UI.Data.CollectionViewSource cvs)
        {
            ICollectionView collectionViews = this.CreateNewView(collection);
            ViewTable       viewTable       = this.EnsureViewTableForCollection(collection);
            ViewRecord      viewRecord      = new ViewRecord(collectionViews);

            viewTable[cvs] = viewRecord;
            ((IViewLifetime)collectionViews).ViewManagerData = viewTable;
            this.Cleanup();
            return(viewRecord);
        }
Пример #2
0
 internal ViewRecord this[object o]
 {
     get
     {
         ViewRecord viewRecord = null;
         this.cvsToViewRecord.TryGetValue(new WeakRefKey(o), out viewRecord);
         return(viewRecord);
     }
     set
     {
         this.cvsToViewRecord[new WeakRefKey(o)] = value;
     }
 }
Пример #3
0
        internal ViewRecord GetViewRecord(object collection, Appercode.UI.Data.CollectionViewSource cvs)
        {
            ViewTable  item       = this[collection];
            ViewRecord viewRecord = null;

            if (item != null)
            {
                viewRecord = item[cvs];
                if (viewRecord != null)
                {
                    return(viewRecord);
                }
            }
            return(this.CreateAndCacheNewView(collection, cvs));
        }
Пример #4
0
 private ViewRecord CreateAndCacheNewView(object collection, Appercode.UI.Data.CollectionViewSource cvs)
 {
     ICollectionView collectionViews = this.CreateNewView(collection);
     ViewTable viewTable = this.EnsureViewTableForCollection(collection);
     ViewRecord viewRecord = new ViewRecord(collectionViews);
     viewTable[cvs] = viewRecord;
     ((IViewLifetime)collectionViews).ViewManagerData = viewTable;
     this.Cleanup();
     return viewRecord;
 }