Option Strict On
Option Explicit On

Namespace Nexamas.UI.Virtualization

    ''' <summary>
    ''' Cached one-dimensional measured item extent. This is a measurement fact only; layout slots and rendering remain owned by
    ''' MASLayout and the future control consumer.
    ''' </summary>
    Friend NotInheritable Class MASVirtualizationMeasurement

        Friend Sub New(index As Integer, extentPx As Single)
            Me.Index = index
            Me.ExtentPx = MASVirtualizationNumericGuard.NormalizeNonNegative(extentPx)
        End Sub

        Friend ReadOnly Property Index As Integer
        Friend ReadOnly Property ExtentPx As Single

        Friend ReadOnly Property IsValid As Boolean
            Get
                Return Index >= 0 AndAlso MASVirtualizationNumericGuard.IsFinitePositive(ExtentPx)
            End Get
        End Property

    End Class

End Namespace
