using System.Collections; using Android.Views; using System.ComponentModel; using System.Collections.ObjectModel; namespace TYTD.Mobile; public class ObservableCollectionRecyclerViewAdapter : IList { private ObservableCollection _coll=new ObservableCollection(); public int Count {get{return _coll.Count;}} public bool IsReadOnly {get{return false;}} public T this[int index] { get {return _coll[index];} set {_coll[index]=value;} } public ObservableCollectionRecyclerViewAdapter(RecylerView,Action viewCb) { } public void Add(T item) { _coll.Add(item); } public void Clear() { _coll.Clear(); } public void AddRange(IEnumerable items) { foreach(var item in items) { _coll.Add(item); } } public int IndexOf(T item) { return _coll.IndexOf(item); } public void Insert(int index, T item) { _coll.Insert(index,item); } public void RemoveAt(int index) { _coll.RemoveAt(index); } public bool Contains(T item) { return _coll.Contains(item); } public void CopyTo(T[] array, int arrayIndex) { _coll.CopyTo(array,arrayIndex); } public bool Remove(T item) { _coll.Remove(item); throw new NotImplementedException(); } public IEnumerator GetEnumerator() { return _coll.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return _coll.GetEnumerator(); } }