Closed pmccowat closed 7 years ago
There's no delay in NotifyTask
.
However, if you are binding tons of data (like thousands of records) all at once, then the data binding will take time. The only way to avoid this is to use data virtualization.
If this doesn't address your problem, then please post a minimal, reproducible example and I'll take a closer look.
Thanks Stephen, this is for one record, the other call is to a list of 12 records which is about the same or quicker. I will look at the WPF code and get an example if it continues to be slow.
Yeah, it should be really fast, then. I mean, unless your DB is slow or something.
No, it's pretty quick - well indexed small table on a fast Azure instance. Only slows when I use NotifyTask to call the data. I normally use your CreateAsync factory idea to construct a viewmodel but I wanted to use the empty constructor here for so looked at the NotifyTask to bind data.
That's odd. All NotifyTask
does is call INotifyPropertyChanged
when the task completes.
Stephen, apologies - it was a previously quick API call that slowed down the same time as I moved to NotifyAsync.
Thanks for letting me know!
Hi Stephen,
I am using NotifyTask to load data in a viewmodel constructor in a WPF project but it is taking a few seconds for the data to show on the screen. It is the same using AsyncEx and possibly related to http://stackoverflow.com/questions/29058130/why-does-this-async-method-still-work-on-ui-thread-and-slow-navigation
My viewmodel is basically the code below and I bind the datacontext of a grid to Test.Result.