ITreeItemContainerGenerator.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System.Collections.Generic;
  4. namespace Perspex.Controls.Generators
  5. {
  6. /// <summary>
  7. /// Creates containers for tree items and maintains a list of created containers.
  8. /// </summary>
  9. public interface ITreeItemContainerGenerator : IItemContainerGenerator
  10. {
  11. /// <summary>
  12. /// Gets the item container for the root of the tree, or null if this generator is itself
  13. /// the root of the tree.
  14. /// </summary>
  15. ITreeItemContainerGenerator RootGenerator { get; }
  16. /// <summary>
  17. /// Gets the item container for the specified item, anywhere in the tree.
  18. /// </summary>
  19. /// <param name="item">The item.</param>
  20. /// <returns>The container, or null if not found.</returns>
  21. IControl TreeContainerFromItem(object item);
  22. /// <summary>
  23. /// Gets the item for the specified item container, anywhere in the tree.
  24. /// </summary>
  25. /// <param name="container">The container.</param>
  26. /// <returns>The item, or null if not found.</returns>
  27. object TreeItemFromContainer(IControl container);
  28. }
  29. }