public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.FragmentListScientists, container, false); button = view.FindViewById <ImageButton>(Resource.Id.addButtonScientist); button.Click += ChangeFragment; lista = view.FindViewById <ListView> (Resource.Id.listaScientist); //lista.Adapter = new AnimalAdapter (this.Context, GetAllAnimals()); lista.Adapter = adapter = new ScientistAdapter(this.Context, GetAllScientists()); lista.Adapter = adapter; lista.ScrollStateChanged += (object sender, Android.Widget.AbsListView.ScrollStateChangedEventArgs scrollArgs) => { switch (scrollArgs.ScrollState) { case ScrollState.Fling: ImageService.SetPauseWork(true); // all image loading requests will be silently canceled break; case ScrollState.Idle: ImageService.SetPauseWork(false); // loading requests are allowed again // Here you should have your custom method that forces redrawing visible list items // (); break; } }; lista.ItemClick += lista_Click; return(view); }
public void RecalculateList() { if (Context != null) { adapter = new ScientistAdapter(this.Context, GetAllScientists()); lista.Adapter = adapter; } }