// Copyright (c) The Perspex Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System; using System.Collections; using System.Collections.Generic; using Perspex.Controls.Templates; namespace Perspex.Controls.Generators { /// /// Creates containers for items and maintains a list of created containers. /// public interface IItemContainerGenerator { /// /// Gets the currently realized containers. /// IEnumerable Containers { get; } /// /// 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 member selector. /// The created controls. IList CreateContainers( int startingIndex, IEnumerable items, IMemberSelector selector); /// /// 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 the number of items to remove. /// The removed containers. IList RemoveContainers(int startingIndex, int count); /// /// 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); } }