// ----------------------------------------------------------------------- // // Copyright 2015 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex.Controls.Generators { using System; using System.Collections; using System.Collections.Generic; using Templates; /// /// Creates containers for items and maintains a list of created containers. /// public interface IItemContainerGenerator { /// /// Signalled whenever new containers are initialized. /// IObservable ContainersInitialized { get; } /// /// Creates container controls for a collection of items. /// /// /// The index of the first item of the data in the containing collection. /// /// The items. /// An optional item template. /// The created controls. IList CreateContainers( int startingIndex, IEnumerable items, IDataTemplate itemTemplate); /// /// Removes a set of created containers from the index and returns the removed controls. /// /// /// The index of the first item of the data in the containing collection. /// /// The items. /// The removed controls. IList RemoveContainers(int startingIndex, IEnumerable items); /// /// Clears the created containers from the index and returns the removed controls. /// /// The removed controls. IList ClearContainers(); /// /// Gets the container control representing the item with the specified index. /// /// The index. /// The container, or null if no container created. IControl ContainerFromIndex(int index); /// /// Gets the index of the specified container control. /// /// The container. /// The index of the container, or -1 if not found. int IndexFromContainer(IControl container); } }