// This source file is adapted from the WinUI project.
// (https://github.com/microsoft/microsoft-ui-xaml)
//
// Licensed to The Avalonia Project under MIT License, courtesy of The .NET Foundation.
using System.Collections.Generic;
namespace Avalonia.Layout
{
///
/// Represents the base class for layout context types that do not support virtualization.
///
public abstract class NonVirtualizingLayoutContext : LayoutContext
{
private VirtualizingLayoutContext? _contextAdapter;
///
/// Gets the collection of child controls from the container that provides the context.
///
public IReadOnlyList Children => ChildrenCore;
///
/// Implements the behavior for getting the return value of in a
/// derived or custom .
///
protected abstract IReadOnlyList ChildrenCore { get; }
internal VirtualizingLayoutContext GetVirtualizingContextAdapter() =>
_contextAdapter ??= new LayoutContextAdapter(this);
}
}