Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinUI - Fix DataGrid scroll performance issue #4867

Open
wants to merge 1 commit into
base: winui
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,11 @@ public int Count
return list.Count;
}

#if FEATURE_PAGEDCOLLECTIONVIEW
PagedCollectionView collectionView = this.DataSource as PagedCollectionView;
var collectionView = this.DataSource as ICollectionView;
if (collectionView != null)
{
return collectionView.Count;
}
#endif

int count = 0;
IEnumerable enumerable = this.DataSource;
Expand Down Expand Up @@ -498,13 +496,11 @@ public object GetDataItem(int index)
return (index < list.Count) ? list[index] : null;
}

#if FEATURE_PAGEDCOLLECTIONVIEW
PagedCollectionView collectionView = this.DataSource as PagedCollectionView;
var collectionView = this.DataSource as ICollectionView;
if (collectionView != null)
{
return (index < collectionView.Count) ? collectionView.GetItemAt(index) : null;
return (index < collectionView.Count) ? collectionView[index] : null;
}
#endif

IEnumerable enumerable = this.DataSource;
if (enumerable != null)
Expand Down Expand Up @@ -579,13 +575,11 @@ public int IndexOf(object dataItem)
return list.IndexOf(dataItem);
}

#if FEATURE_PAGEDCOLLECTIONVIEW
PagedCollectionView cv = this.DataSource as PagedCollectionView;
if (cv != null)
var collectionView = this.DataSource as ICollectionView;
if (collectionView != null)
{
return cv.IndexOf(dataItem);
return collectionView.IndexOf(dataItem);
}
#endif

IEnumerable enumerable = this.DataSource;
if (enumerable != null && dataItem != null)
Expand Down