Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146394 | Aug 2,2019 10:05 AM UTC | Aug 6,2019 11:21 AM UTC | Xamarin.Forms | 2 |
![]() |
Tags: SfListView |
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;
}
} |
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.
This page will automatically be redirected to the sign-in page in 10 seconds.