Items not Updating Inside SFListview

Hello,

I am having a problem with my items not updating in the listview when the itemssource updates. I am using INotifyPropertyChanged and it worked just fine before changing to SFListView. ItemSuggestions (IsAcceptedImagePath) is being updated correctly when an item is tapped, but nothing in the listview is changing.

Relevent Code -ViewModel:

Attached

Xaml:

Attached
       
           
               
                   
                       
                           
                               
                                   
                                   
                                   
                               
                               
                                   
                               

                               
                                   
                                   
                               

                               
                           
                           
                       
                   
               
                
           
       
   

       

       
           
               
                   
                       
                           
                               
                                   
                                   
                                   
                               
                               
                                   
                               

                               
                                   
                                   
                               

                               
                           
                           
                       
                   
               
           
           
       
   

       

3 Replies 1 reply marked as answer

SB Spencer Bosley January 14, 2021 07:08 PM UTC

Pictures of code attached in this reply.

Attachment: Pictures_c0f773e5.zip


SB Spencer Bosley January 14, 2021 10:37 PM UTC

Update - The SfListView does not update the items when .RefreshView() is called on it.



LN Lakshmi Natarajan Syncfusion Team January 15, 2021 09:19 AM UTC

Hi Spencer, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “Items not Updating Inside SFListview” from our side. We would like to inform you that if you are updating the properties bound to the ItemTemplate at run time, we suggest you to implement the INotifyPropertyChanged for the properties (IsAcceptedImagePath) to reflect the run time updates in the UI. Please refer to the following code snippets for more reference, 
 
    public class Contacts : INotifyPropertyChanged 
    { 
        private ImageSource image;            
         
 
        public ImageSource IsAcceptedImagePath 
        { 
            get { return this.image; } 
            set 
            { 
                this.image = value; 
                this.RaisedOnPropertyChanged("IsAcceptedImagePath"); 
            } 
        } 
 
        public event PropertyChangedEventHandler PropertyChanged; 
 
        public void RaisedOnPropertyChanged(string _PropertyName) 
        { 
            if (PropertyChanged != null) 
            { 
                PropertyChanged(this, new PropertyChangedEventArgs(_PropertyName)); 
            } 
        } 
    } 
 
Please refer to our user guidance document regarding the same from the following link,  
 
We have prepared a sample to update the image at run time and you can find the tested sample in the following link, 
 
Additional information: 
Tested device: 
Android – Pixel 3XL Q 10 (Android 10 – API 29) emulator 
iOS – iPhone 12 Pro Max - iOS 14.1 
UWP 
SfListView version: 18.3.0.44 
Xamarin Forms: 4.8.0.1451 
Xamarin: 16.7.000.456 
Xamarin Designer: 16.7.0.495 
Xamarin Templates: 16.7.85 
Xamarin Android SDK: 11.0.2.0 
Xamarin.iOS: 14.1 
Xcode: 12.1 
  
Please check our sample and let us know if you still facing the same issue? if not, please modify our sample and revert us back with the following details which would be helpful for us to check on it and provide you the solution as soon as possible, 
  • Share ViewModel and model code snippets
  • Share the property update code snippets
  • Share device configuration details
  • Share Syncfusion and Xamarin.Forms version
 
Lakshmi Natarajan 
 


Marked as answer
Loader.
Up arrow icon