Beispiel #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>();
        }
        private List <DataGridGroupInfo> BuildGroupPath()
        {
            DataGridVirtualizingCollectionViewGroup parent = this.Parent as DataGridVirtualizingCollectionViewGroup;

            if (parent == null)
            {
                return(new List <DataGridGroupInfo>());
            }

            DataGridVirtualizingCollectionViewBase collectionView = this.GetCollectionView();

            ObservableCollection <GroupDescription> groupDescriptions = collectionView.GroupDescriptions;

            int level = this.Level;

            Debug.Assert(this.Level != -1, "A DataGridCollectionViewGroupRoot should have returned a new List since its parent should have been null.");

            List <DataGridGroupInfo> groupPath = new List <DataGridGroupInfo>(parent.GroupPath);

            Debug.Assert(groupDescriptions.Count > level);

            if (groupDescriptions.Count > level)
            {
                groupPath.Add(new DataGridGroupInfo(groupDescriptions[level], this));
            }

            return(groupPath);
        }
    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 QueryItemCountEventArgs(DataGridVirtualizingCollectionView collectionView,
                                         DataGridVirtualizingCollectionViewGroup collectionViewGroup)
        {
            m_dataGridVirtualizingCollectionView = collectionView;
            m_readonlyGroupPath = collectionViewGroup.GroupPath.AsReadOnly();

            m_count = -1;
        }
    internal QueryItemCountEventArgs( DataGridVirtualizingCollectionView collectionView, 
      DataGridVirtualizingCollectionViewGroup collectionViewGroup )
    {
      m_dataGridVirtualizingCollectionView = collectionView;
      m_readonlyGroupPath = collectionViewGroup.GroupPath.AsReadOnly();

      m_count = -1;
    }
 internal DataGridVirtualizingCollectionViewGroup(
   object name,
   int initialItemsCount,
   int startGlobalIndex,
   DataGridVirtualizingCollectionViewGroup parent,
   int level,
   bool isBottomLevel )
   : base( name, initialItemsCount, startGlobalIndex, parent, level, isBottomLevel )
 {
 }
 internal DataGridVirtualizingCollectionViewGroup(
     object name,
     int initialItemsCount,
     int startGlobalIndex,
     DataGridVirtualizingCollectionViewGroup parent,
     int level,
     bool isBottomLevel)
     : base(name, initialItemsCount, startGlobalIndex, parent, level, isBottomLevel)
 {
 }
    internal int OnQueryItemCount( DataGridVirtualizingCollectionViewGroup collectionViewGroup )
    {
      QueryItemCountEventArgs e = new QueryItemCountEventArgs( this, collectionViewGroup );

      if( this.QueryItemCount != null )
        this.QueryItemCount( this, e );

      DataGridVirtualizingCollectionViewSource source = this.ParentCollectionViewSourceBase as DataGridVirtualizingCollectionViewSource;

      if( source != null )
        source.OnQueryItemCount( e );

      return e.Count;
    }
        internal void OnQueryItems(AsyncQueryInfo asyncQueryInfo, DataGridVirtualizingCollectionViewGroup collectionViewGroup)
        {
            QueryItemsEventArgs e = new QueryItemsEventArgs(this, collectionViewGroup, asyncQueryInfo);

            if (this.QueryItems != null)
            {
                this.QueryItems(this, e);
            }

            DataGridVirtualizingCollectionViewSource source = this.ParentCollectionViewSourceBase as DataGridVirtualizingCollectionViewSource;

            if (source != null)
            {
                source.OnQueryItems(e);
            }
        }
        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);
        }
Beispiel #11
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;
        }
    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;
    }
        internal int OnQueryItemCount(DataGridVirtualizingCollectionViewGroup collectionViewGroup)
        {
            QueryItemCountEventArgs e = new QueryItemCountEventArgs(this, collectionViewGroup);

            if (this.QueryItemCount != null)
            {
                this.QueryItemCount(this, e);
            }

            DataGridVirtualizingCollectionViewSource source = this.ParentCollectionViewSourceBase as DataGridVirtualizingCollectionViewSource;

            if (source != null)
            {
                source.OnQueryItemCount(e);
            }

            return(e.Count);
        }
        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 List <GroupNameCountPair> OnQueryGroups(DataGridVirtualizingCollectionViewGroup parentGroup)
        {
            ObservableCollection <GroupDescription> groupDescriptions = this.GroupDescriptions;
            int nextLevel = parentGroup.Level + 1;

            Debug.Assert((groupDescriptions != null) && (groupDescriptions.Count > nextLevel));

            QueryGroupsEventArgs e = new QueryGroupsEventArgs(this, parentGroup, groupDescriptions[nextLevel]);

            if (this.QueryGroups != null)
            {
                this.QueryGroups(this, e);
            }

            DataGridVirtualizingCollectionViewSource source = this.ParentCollectionViewSourceBase as DataGridVirtualizingCollectionViewSource;

            if (source != null)
            {
                source.OnQueryGroups(e);
            }

            return(e.ChildGroupNameCountPairs);
        }
    internal List<GroupNameCountPair> OnQueryGroups( DataGridVirtualizingCollectionViewGroup parentGroup )
    {
      ObservableCollection<GroupDescription> groupDescriptions = this.GroupDescriptions;
      int nextLevel = parentGroup.Level + 1;

      Debug.Assert( ( groupDescriptions != null ) && ( groupDescriptions.Count > nextLevel ) );

      QueryGroupsEventArgs e = new QueryGroupsEventArgs( this, parentGroup, groupDescriptions[ nextLevel ] );

      if( this.QueryGroups != null )
        this.QueryGroups( this, e );

      DataGridVirtualizingCollectionViewSource source = this.ParentCollectionViewSourceBase as DataGridVirtualizingCollectionViewSource;

      if( source != null )
        source.OnQueryGroups( e );

      return e.ChildGroupNameCountPairs;
    }
    internal void OnQueryItems( AsyncQueryInfo asyncQueryInfo, DataGridVirtualizingCollectionViewGroup collectionViewGroup )
    {
      QueryItemsEventArgs e = new QueryItemsEventArgs( this, collectionViewGroup, asyncQueryInfo );

      if( this.QueryItems != null )
        this.QueryItems( this, e );

      DataGridVirtualizingCollectionViewSource source = this.ParentCollectionViewSourceBase as DataGridVirtualizingCollectionViewSource;

      if( source != null )
        source.OnQueryItems( e );
    }