@@ -123,13 +123,11 @@ public int Count
123
123
return list . Count ;
124
124
}
125
125
126
- #if FEATURE_PAGEDCOLLECTIONVIEW
127
- PagedCollectionView collectionView = this . DataSource as PagedCollectionView ;
126
+ var collectionView = this . DataSource as PagedCollectionView ;
128
127
if ( collectionView != null )
129
128
{
130
129
return collectionView . Count ;
131
130
}
132
- #endif
133
131
134
132
int count = 0 ;
135
133
IEnumerable enumerable = this . DataSource ;
@@ -498,13 +496,11 @@ public object GetDataItem(int index)
498
496
return ( index < list . Count ) ? list [ index ] : null ;
499
497
}
500
498
501
- #if FEATURE_PAGEDCOLLECTIONVIEW
502
- PagedCollectionView collectionView = this . DataSource as PagedCollectionView ;
499
+ var collectionView = this . DataSource as PagedCollectionView ;
503
500
if ( collectionView != null )
504
501
{
505
- return ( index < collectionView . Count ) ? collectionView . GetItemAt ( index ) : null ;
502
+ return ( index < collectionView . Count ) ? collectionView [ index ] : null ;
506
503
}
507
- #endif
508
504
509
505
IEnumerable enumerable = this . DataSource ;
510
506
if ( enumerable != null )
@@ -579,13 +575,11 @@ public int IndexOf(object dataItem)
579
575
return list . IndexOf ( dataItem ) ;
580
576
}
581
577
582
- #if FEATURE_PAGEDCOLLECTIONVIEW
583
- PagedCollectionView cv = this . DataSource as PagedCollectionView ;
584
- if ( cv != null )
578
+ var collectionView = this . DataSource as PagedCollectionView ;
579
+ if ( collectionView != null )
585
580
{
586
- return cv . IndexOf ( dataItem ) ;
581
+ return collectionView . IndexOf ( dataItem ) ;
587
582
}
588
- #endif
589
583
590
584
IEnumerable enumerable = this . DataSource ;
591
585
if ( enumerable != null && dataItem != null )
0 commit comments