Esempio n. 1
0
        internal QueryGroupsEventArgs(
            DataGridVirtualizingCollectionView collectionView,
            DataGridVirtualizingCollectionViewGroup parentGroup,
            GroupDescription childGroupDescription)
        {
            m_dataGridVirtualizingCollectionView = collectionView;
            m_readonlyGroupPath         = parentGroup.GroupPath.AsReadOnly();
            m_childGroupDescription     = childGroupDescription;
            this.ChildGroupPropertyName = DataGridCollectionViewBase.GetPropertyNameFromGroupDescription(childGroupDescription);

            m_sortDirection = SortDirection.None;

            SortDescriptionCollection sortDescriptions = m_dataGridVirtualizingCollectionView.SortDescriptions;

            int sortDescriptionCount = (sortDescriptions == null) ? 0 : sortDescriptions.Count;

            for (int i = 0; i < sortDescriptions.Count; i++)
            {
                SortDescription sortDescription = sortDescriptions[i];

                if (string.Equals(sortDescription.PropertyName, this.ChildGroupPropertyName))
                {
                    m_sortDirection = (sortDescription.Direction == ListSortDirection.Ascending) ? SortDirection.Ascending : SortDirection.Descending;
                    break;
                }
            }

            m_childGroupNameCountPairs = new List <GroupNameCountPair>();
        }
        internal override ObservableCollection <object> QuerySubCollectionViewGroupList(GroupDescription subGroupBy, int nextLevel, bool nextLevelIsBottom)
        {
            DataGridVirtualizingCollectionView collectionView = this.GetCollectionView() as DataGridVirtualizingCollectionView;

            Debug.Assert(collectionView != null);

            List <GroupNameCountPair> subGroupInfos = collectionView.OnQueryGroups(this);
            int subGroupCount = subGroupInfos.Count;

            // Create the collection of sub CollectionViewGroups
            ObservableCollection <object> subCollectionViewGroupList = new ObservableCollection <object>();

            int runningCount = this.StartGlobalIndex;

            for (int i = 0; i < subGroupCount; i++)
            {
                object subGroupName      = subGroupInfos[i].Name;
                int    subGroupItemCount = subGroupInfos[i].ItemCount;

                subCollectionViewGroupList.Add(
                    new DataGridVirtualizingCollectionViewGroup(subGroupName, subGroupItemCount, runningCount, this, nextLevel, nextLevelIsBottom));

                runningCount += subGroupItemCount;
            }

            return(subCollectionViewGroupList);
        }
Esempio n. 3
0
        internal QueryItemCountEventArgs(DataGridVirtualizingCollectionView collectionView,
                                         DataGridVirtualizingCollectionViewGroup collectionViewGroup)
        {
            m_dataGridVirtualizingCollectionView = collectionView;
            m_readonlyGroupPath = collectionViewGroup.GroupPath.AsReadOnly();

            m_count = -1;
        }
Esempio n. 4
0
        protected internal override void OnQueryItemsCompleted(VirtualPage page, AsyncQueryInfo queryInfo, object[] fetchedItems)
        {
            DataGridVirtualizingCollectionView collectionView = this.CollectionView as DataGridVirtualizingCollectionView;

            // The VirtualPageManager was Disposed
            if (collectionView == null)
            {
                return;
            }

            using (collectionView.DeferRefresh())
            {
                base.OnQueryItemsCompleted(page, queryInfo, fetchedItems);
            }
        }
Esempio n. 5
0
        protected internal override void OnAbortQueryItems(VirtualPage page, AsyncQueryInfo queryInfo)
        {
            DataGridVirtualizingCollectionView collectionView = this.CollectionView as DataGridVirtualizingCollectionView;

            // The VirtualPageManager was Disposed
            if (collectionView == null)
            {
                return;
            }

            DataGridVirtualizingCollectionViewGroup collectionViewGroup = this.GetLinkedCollectionViewGroup(page.ParentVirtualList) as DataGridVirtualizingCollectionViewGroup;

            collectionView.OnAbortQueryItems(queryInfo, collectionViewGroup);

            base.OnAbortQueryItems(page, queryInfo);
        }
Esempio n. 6
0
        internal QueryItemsEventArgs(
            DataGridVirtualizingCollectionView collectionView,
            DataGridVirtualizingCollectionViewGroup collectionViewGroup,
            AsyncQueryInfo asyncQueryInfo)
        {
            m_dataGridVirtualizingCollectionView = collectionView;

            // The collectionViewGroup can be null when we abort
            // a QueryItems for the old RootGroup when
            // DataGridVirtualizingCollectionViewBase.ForceRefresh
            // is called
            m_readonlyGroupPath = (collectionViewGroup != null)
        ? collectionViewGroup.GroupPath.AsReadOnly()
        : new ReadOnlyCollection <DataGridGroupInfo>(new List <DataGridGroupInfo>());

            m_asyncQueryInfo = asyncQueryInfo;
        }
Esempio n. 7
0
        protected override int OnQueryItemCountCore(VirtualList virtualList)
        {
            if (!this.IsConnected)
            {
                return(0);
            }

            DataGridVirtualizingCollectionView collectionView = this.CollectionView as DataGridVirtualizingCollectionView;

            // The VirtualPageManager was Disposed
            if (collectionView == null)
            {
                return(0);
            }

            DataGridVirtualizingCollectionViewGroup collectionViewGroup = this.GetLinkedCollectionViewGroup(virtualList) as DataGridVirtualizingCollectionViewGroup;

            Debug.Assert((collectionViewGroup != null) && (collectionView != null));

            return(collectionView.OnQueryItemCount(collectionViewGroup));
        }
 internal DataGridVirtualizingCollectionViewGroupRoot(DataGridVirtualizingCollectionView collectionView, bool isBottomLevel)
     : base(null, -1, 0, null, -1, isBottomLevel)
 {
     m_parentCollectionView = collectionView;
     m_virtualPageManager   = new DataGridPageManager(collectionView);
 }
Esempio n. 9
0
 public DataGridPageManager(DataGridVirtualizingCollectionView collectionView)
     : base(collectionView)
 {
 }
        internal override int QueryItemCount()
        {
            DataGridVirtualizingCollectionView collectionView = this.GetCollectionView() as DataGridVirtualizingCollectionView;

            return(collectionView.OnQueryItemCount(this));
        }