﻿Option Strict On
Option Explicit On

Imports System
Imports System.Collections.Generic
Imports System.Globalization
Imports System.IO
Imports Nexamas.UI.Application
Imports Nexamas.UI.Components
Imports Nexamas.UI.Components.DropDownMenu
Imports Nexamas.UI.Controls
Imports Nexamas.UI.FileSystem
Imports Nexamas.UI.Icons
Imports Nexamas.UI.Layout
Imports Nexamas.UI.Localization
Imports Nexamas.UI.Output
Imports Nexamas.UI.Theming
Imports Nexamas.UI.TextInput
Imports Nexamas.UI.Verification
Imports SkiaSharp

''' <summary>
''' Element Coverage proof tokens kept with the PageHost dispatcher for the coverage gate:
''' BuildElementCoverage(page As MASApplicationLayoutPageBuilder, window As MASApplicationWindow)
''' window.Controls.AddTitle("Official Element Coverage") / MASTitle
''' PopulateElementCoverageRows(view)
''' Shell menu trigger / MASMenuButton
''' Same-window Showcase page bodies for MASApplicationWindow.Pages.
''' This builder contributes only Nexamas.UI public controls and public application/layout verbs.
''' It does not create a second navigation host or decide Nexamas.UI-owned evidence internally.
''' The dedicated Multi-window / Lifetime scenario may create a plain WinForms owner solely to
''' exercise MASApplication.CreateWindow(owner); Nexamas.UI still owns the child window surface.
''' The launcher supplies the official MASApplicationWindow.Pages route.
''' </summary>
Partial Friend NotInheritable Class ShowcasePageHostContentBuilder
    Private Const ScoreColumnIndex As Integer = 4
    Private Const PremiumFilterExpression As String = "status:Ready score>=86"

    Private Sub New()
    End Sub

    Friend Shared Sub Build(page As MASApplicationLayoutPageBuilder,
                            window As MASApplicationWindow,
                            entry As ShowcaseNavigationEntry,
                            Optional topBar As MASTopBarComponent = Nothing,
                            Optional application As MASApplication = Nothing,
                            Optional registerLifetime As Action(Of IDisposable) = Nothing)
        If page Is Nothing OrElse window Is Nothing OrElse entry Is Nothing Then Return

        ' The outer Showcase route applies the unified page surface once before
        ' menu, route summary, and body composition. The body builder must not reset
        ' spacing/padding, reintroduce a narrower page profile, or append the
        ' Showcase metadata/footer sections by itself.

        Select Case entry.Id
            Case "certification.center"
                BuildCertificationCenterSummary(page, window)
            Case "application.architecture"
                BuildApplicationArchitecture(page, window)
            Case "application.lifetime"
                BuildApplicationLifetime(page, window, application, registerLifetime)
            Case "core.documentation"
                BuildCoreDocumentationMap(page, window)
            Case "licensing.evaluation"
                BuildLicensingEvaluation(page, window)
            Case "element.coverage"
                BuildElementCoverage(page, window)
            Case "workflow.foundations"
                BuildWorkflowFoundations(page, window)
            Case "commercial.foundations"
                BuildCommercialFoundationDecisions(page, window)
            Case "output.product"
                BuildOutputProductSdkConsumption(page, window, application)
            Case "localization.rtl.product"
                BuildLocalizationRtlProductPage(page, window, registerLifetime)
            Case "theme.studio"
                BuildThemeStudio(page, window)
            Case "surface.materials"
                BuildSurfaceMaterials(page, window, topBar)
            Case "datagrid"
                BuildDataGrid(page, window)
            Case "data.analytics"
                BuildDataAnalytics(page, window)
            Case "planning.workspace"
                BuildPlanningWorkspace(page, window)
            Case "productivity.navigation"
                BuildProductivityNavigation(page, window)
            Case "charts.dashboard"
                BuildChartDashboard(page, window)
            Case "property.inspector"
                BuildPropertyGridInspector(page, window)
            Case "motion"
                BuildMotion(page, window)
            Case "render.verification"
                BuildRenderVerification(page, window)
            Case "diagnostics.dashboard"
                BuildDiagnosticsDashboard(page, window)
            Case "dpi.text.accessibility"
                BuildDpiTextAccessibility(page, window)
            Case "packaging.consumer"
                BuildPackagingConsumerUse(page, window)
            Case "virtualization"
                BuildVirtualization(page, window)
            Case "services"
                BuildServices(page, window)
            Case "buttons"
                BuildButtons(page, window)
            Case "inputs"
                BuildInputs(page, window)
            Case "feedback.status"
                BuildFeedbackStatus(page, window)
            Case "selection"
                BuildSelection(page, window)
            Case "lists.tree"
                BuildListsAndTree(page, window)
            Case "icon.resolution"
                BuildIconResolution(page, window)
            Case "tiles"
                BuildTiles(page, window)
            Case "visual.editors"
                BuildVisualEditors(page, window)
            Case "file.surfaces"
                BuildFileSurfaces(page, window)
            Case "settings.sizing"
                BuildSettingsSizing(page, window)
            Case Else
                BuildUnknownPage(page, window, entry)
        End Select

    End Sub
End Class
