Best way to display IObservable values in TreeDataGrid #15671
Unanswered
heuristicAL
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sorry for the crosspost. I posted a day ago in the TreeDataGrid repo and then figured that this might be a more appropriate place for it.
Hi! This is less of an "issue" and more of a "What is the recommended way of doing x" thing...
Preface
I currently have an app that uses TreeDataGrid to display data. The project and data is setup as follows:
DynamicData
Iobservable<IChangeSet>
is bound to aReadonlyObservableCollection
.ReadonlyObservableCollection
is supplied as the source list forFlatTreeDataGridSource
.Problem
I tried exposing the properties as
IObservables
and just binding to the observables themselves in theaxaml
file, using the^
stream binding operator. The values populate properly and update as expected when the view is static. Unfortunately, when a user starts to scroll, we encounter 2 issues:I tried adding a
.Replay(1)
to my observables to see if it would help with the pop-in and it did not.Since I have another TreeDataGrid in the app that has static data once bound (almost static) and that THAT TreeDataGrid performs extremely well even when scrolling through over 30k items, I figured the observables might be the issue.
In an effort to remedy that, I bound each of the observables to an
ObservableAsPropertyHelper
property.More info here and, since I use ToPropertyEx, here.
This actually did help some but only for the pop-in issues. The props are now already populated when the row scrolls into view but the scrolling still hitches SIGNIFICANTLY, even though I might have less than 100 rows in the grid.
Rather than try 15 different combinations of methods to try to fix this, I thought I'd reach out and pick the brains of the people who built the Grid to see what you think is the best solution!
Thanks in advance for the help!
Beta Was this translation helpful? Give feedback.
All reactions