// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Layout;
namespace Avalonia.Controls
{
///
/// A panel that can be used to virtualize items.
///
public interface IVirtualizingPanel : IPanel
{
///
/// Gets or sets the controller for the virtualizing panel.
///
///
/// A virtualizing controller is responsible for maintaining the controls in the virtualizing
/// panel. This property will be set by the controller when virtualization is initialized.
/// Note that this property may remain null if the panel is added to a control that does
/// not act as a virtualizing controller.
///
IVirtualizingController Controller { get; set; }
///
/// Gets a value indicating whether the panel is full.
///
///
/// This property should return false until enough children are added to fill the space
/// passed into the last measure or arrange in the direction of scroll. It should be
/// updated immediately after a child is added or removed.
///
bool IsFull { get; }
///
/// Gets the number of items that can be removed while keeping the panel full.
///
///
/// This property should return the number of children that are completely out of the
/// panel's current bounds in the direction of scroll. It should be updated after an
/// arrange.
///
int OverflowCount { get; }
///
/// Gets the direction of scroll.
///
Orientation ScrollDirection { get; }
///
/// Gets the average size of the materialized items in the direction of scroll.
///
double AverageItemSize { get; }
///
/// Gets or sets a size in pixels by which the content is overflowing the panel, in the
/// direction of scroll.
///
///
/// This may be non-zero even when is zero if the last item
/// overflows the panel bounds.
///
double PixelOverflow { get; }
///
/// Gets or sets the current pixel offset of the items in the direction of scroll.
///
double PixelOffset { get; set; }
///
/// Gets or sets the current scroll offset in the cross axis.
///
double CrossAxisOffset { get; set; }
///
/// Invalidates the measure of the control and forces a call to
/// on the next measure.
///
///
/// The implementation for this method should call
/// and also ensure that the next call to
/// calls
/// on the next measure even if
/// the available size hasn't changed.
///
void ForceInvalidateMeasure();
}
}