Option Strict On
Option Explicit On

Imports System
Imports System.Collections.Generic
Imports Nexamas.UI.Controls
Imports Nexamas.UI.Host
Imports Nexamas.UI.Layout
Imports Nexamas.UI.Theming
Imports SkiaSharp

Namespace Nexamas.UI.Application


    Friend NotInheritable Class MASApplicationLayoutRegionEntry
        Friend ReadOnly Property BoundsLogical As SKRect
        Private ReadOnly _page As MASApplicationLayoutPageBuilder

        Friend Sub New(boundsLogical As SKRect, page As MASApplicationLayoutPageBuilder)
            Me.BoundsLogical = boundsLogical
            _page = If(page, New MASApplicationLayoutPageBuilder())
        End Sub

        Friend ReadOnly Property IsVerticalScrollEnabled As Boolean
            Get
                Return _page IsNot Nothing AndAlso _page.IsVerticalScrollEnabledInternal
            End Get
        End Property

        Friend ReadOnly Property VerticalScrollKey As String
            Get
                If _page Is Nothing Then Return "MASApplicationWindow.Pages.Workspace"
                Return _page.VerticalScrollKeyInternal
            End Get
        End Property

        Friend Function BuildNode(Optional sizeProfile As MASSizeProfile = Nothing) As MASLayoutNode
            Return _page.BuildNode(sizeProfile)
        End Function

        Friend Sub CollectControls(target As IList(Of MASControlBase))
            If target Is Nothing Then Return
            _page.CollectControls(target)
        End Sub
    End Class

End Namespace
