/// <summary> /// Initializes a new instance of the <see cref="VirtualPagingItemViewModel{TItem, TModel}"/> class. /// </summary> /// <param name="parent">The parent.</param> /// <param name="container">The container.</param> /// <param name="createVmFunc">The create vm function.</param> public VirtualPagingItemViewModel(PagingScreenViewModel parent, VirtualContainer <TModel> container, Func <TModel, Task <TItem> > createVmFunc) { SetParent(parent); Index = container.Index; _container = container; _createVmFunc = createVmFunc; _container.NotifyOn("Model", OnModelArrived); }
/// <summary> /// Gets or sets the element at the specified index. /// </summary> /// <returns> /// The element at the specified index. /// </returns> /// <param name="index">The zero-based index of the element to get or set.</param><exception cref="T:System.ArgumentOutOfRangeException"><paramref name="index"/> is not a valid index in the <see cref="T:System.Collections.Generic.IList`1"/>.</exception><exception cref="T:System.NotSupportedException">The property is set and the <see cref="T:System.Collections.Generic.IList`1"/> is read-only.</exception> public VirtualContainer <T> this[int index] { get { int segmentIndex = GetSegmentIndex(index); Segment segment = GetSegment(segmentIndex); VirtualContainer <T> current = segment[index]; return(current); } set { throw new NotImplementedException(); } }
/// <summary> /// Initializes a new instance of the <see cref="VirtualPagingItemListViewModel{TItem, TModel}"/> class. /// </summary> /// <param name="parent">The parent.</param> /// <param name="source">The source.</param> protected VirtualPagingItemListViewModel(object parent, VirtualContainer <TModel> .Collection source) : base(parent, source) { }
/// <summary> /// Initializes a new instance of the <see cref="VirtualPagingItemViewModel{TItem, TModel}"/> class. /// </summary> /// <param name="parent">The parent.</param> /// <param name="container">The container.</param> /// <param name="createVmFunc">The create vm function.</param> public VirtualPagingItemViewModel(PagingScreenViewModel parent, VirtualContainer <TModel> container, Func <TModel, TItem> createVmFunc) : this(parent, container, model => Task <TItem> .Factory.StartNew(() => createVmFunc(model))) { }
void IList <VirtualContainer <T> > .Insert(int index, VirtualContainer <T> item) { throw new NotImplementedException(); }
int IList <VirtualContainer <T> > .IndexOf(VirtualContainer <T> item) { return(-1); }
bool ICollection <VirtualContainer <T> > .Remove(VirtualContainer <T> item) { throw new NotImplementedException(); }
void ICollection <VirtualContainer <T> > .Add(VirtualContainer <T> item) { throw new NotImplementedException(); }