using System.Collections; using System.Collections.Generic; namespace Xamarin.Forms { internal class ReadOnlyCastingList : IReadOnlyList where T : class where TFrom : class { readonly IList _list; public ReadOnlyCastingList(IList list) { _list = list; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_list).GetEnumerator(); } public IEnumerator GetEnumerator() { return new CastingEnumerator(_list.GetEnumerator()); } public int Count { get { return _list.Count; } } public T this[int index] { get { return _list[index] as T; } } } }