We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Swap image by program

Thread ID:

Created:

Updated:

Platform:

Replies:

146394 Aug 2,2019 10:05 AM UTC Aug 6,2019 11:21 AM UTC Xamarin.Forms 2
loading
Tags: SfListView
Nilmar Castro
Asked On August 2, 2019 10:05 AM UTC

I would like some example of how to at any given time swap the image in a ListView in SfListView-Image.

Thank you for now

Sangeetha Raju [Syncfusion]
Replied On August 4, 2019 05:08 PM UTC

Hi Nilmer, 
 
We are validating your query. We will update the details further on or before August 6, 2019.  
 
We appreciate your patience until then. 
 
Regards, 
Sangeetha Raju. 


Sangeetha Raju [Syncfusion]
Replied On August 6, 2019 11:21 AM UTC

Hi Nilmer, 
 
We would like to let you know that we have achieved your requirement “Swap image by program” using button click event as like below code snippet. 
 
Behavior.cs 
public class Behavior : Behavior<ContentPage> 
{ 
   Button Swap; 
   SfListView ListView; 
   Random random = new Random(); 
   protected override void OnAttachedTo(ContentPage bindable) 
   { 
      Swap = bindable.FindByName<Button>("button"); 
      ListView = bindable.FindByName<SfListView>("listView"); 
      Swap.Clicked += Swap_Clicked; 
      base.OnAttachedTo(bindable); 
   } 
 
   private void Swap_Clicked(object sender, EventArgs e) 
   { 
      var contact = new Model(); 
      contact.Image = ImageSource.FromResource("SfListViewSamples.Images.Image" + random.Next(0, 19) + ".png"); 
      (ListView.BindingContext as ViewModel).ContactsInfo[0] = contact; 
   } 
} 
 
We have attached the tested sample for your reference, please find the sample in the below link. 
 
 
Please let us know whether the provided sample meets your requirement. 
 
Regards,
Sangeetha Raju.
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon