Add item in ViewModel not update listview UI

Hi, since version 18.1.0.48 when I update my nuget all my Views with sflistview not refresh and not show items after insert in collection from ViewModel. I think was a bug temporary so wait for correction. Today I spend a time creating a test project e comparing and find a problem.

Problem:
Don't instance Page in another thread, my old code

var page = await Task.Run(t => new MyPage());

Solution:
Create always Page in main thread

var page = new MyPage(); 

Hope this can help someone. English is not my first language :)

3 Replies

SS SaiGanesh Sakthivel Syncfusion Team August 10, 2020 12:15 PM UTC

Hi Gabriel,  
  
Thank you for contacting syncfusion support.  
  
We have checked the reported query “Add item in ViewModel not update listview UI” from our end. We would like to inform that we could not able to replicate the reported scenario from our end. We have attached the tested sample in the following link for your reference.  
  
  
Please let us know it you still facing the same issue. If not, could you please share the following details which would be helpful for us to check on it and provide you the solution at the earliest.   
  
·       Modify our sample / Share layouts used in Xaml page.  
·       Model and viewmodel used in the project.  
·       Procedure to replicate the issue.  
·       Share the Syncfusion version. 

 
Regards, 
SaiGanesh Sakthivel 
 



GD gabriel de sousa August 10, 2020 12:33 PM UTC

Hi, I send you my sample. To reproduce the problem create a new page with sflistview in another thread. I put TODO in my sample
Attachment: App1_26cf8c0.rar


SS SaiGanesh Sakthivel Syncfusion Team August 11, 2020 12:27 PM UTC

Hi Gabriel,  
  
Thank you for the update.  
  
#Regarding Add item in ViewModel not update listview UI  
We would like to inform you that as per implementation, the ListView UI will be updated in the MainThread. Hence, running the page which has ListView in separate thread is not the recommended process.  
  
Regards,  
SaiGanesh Sakthivel 


Loader.
Up arrow icon