Option Strict On
Option Explicit On

Imports Nexamas.UI.Controls
Imports SkiaSharp

Namespace Nexamas.UI.Components

    Partial Public NotInheritable Class MASAppLayout

#Region "Friend host adoption proof"

        Friend Function CreateResponsiveShellHostAdoptionSnapshot() As MASRouteShellHostAdoptionSnapshot
            Return MASRouteShellHostAdoptionPolicy.CreateAppLayoutAdoption(
                CreateRouteOwnershipBoundarySnapshot(),
                CreateLayoutSnapshot(),
                CreateHostedSlotContentSnapshot())
        End Function

        Friend Function HasResponsiveShellHostAdoptionForTests() As Boolean
            Dim content As MASControlBase = MASButton.Create("App host adoption content")
            If Not HostSlotContent("content", content) Then Return False
            PlaceAppLayoutHostedContent("content", New SKRect(0.0F, 72.0F, 480.0F, 320.0F), 1.0F, True)
            Dim snapshot As MASRouteShellHostAdoptionSnapshot = CreateResponsiveShellHostAdoptionSnapshot()
            Dim passed As Boolean = MASRouteShellHostAdoptionPolicy.IsSafeHostAdoption(snapshot,
                                                                                       "applayout",
                                                                                       "AppLayout.ResponsiveShellAdoption",
                                                                                       MASRouteShellBoundaryKind.AppLayoutRouteOwnership) AndAlso
                                    snapshot.CapturesResponsiveIntent AndAlso
                                    Not snapshot.CapturesFocusIntent AndAlso
                                    snapshot.KeepsRouterExternal AndAlso
                                    snapshot.KeepsPageHostExternal
            Dim removed As Boolean = UnhostSlotContent("content", disposeChild:=True)
            Return passed AndAlso removed
        End Function

#End Region

    End Class

End Namespace
