Option Strict On
Option Explicit On

Imports Nexamas.UI.Values

Namespace Nexamas.UI.Controls

    ''' <summary>
    ''' Friend-owned flow-boundary policy for MASWizard. It proves that wizard navigation
    ''' composes the official MASStepper route and MAS child-content slots without opening
    ''' public page objects, a workflow service, validation engine, action/cancel service,
    ''' hidden Form/UserControl host, timer, task, or parallel guided-flow path.
    ''' </summary>
    Friend NotInheritable Class MASWizardFlowPolicy
        Private Sub New()
        End Sub

        Friend Shared Function NormalizeOrientation(value As MASStepperOrientation) As MASStepperOrientation
            Return MASStepperFlowPolicy.NormalizeOrientation(value)
        End Function

        Friend Shared Function CanMoveNext(currentIndex As Integer,
                                           stepCount As Integer) As Boolean
            Return currentIndex >= 0 AndAlso currentIndex < stepCount - 1
        End Function

        Friend Shared Function CanMovePrevious(currentIndex As Integer,
                                               stepCount As Integer) As Boolean
            Return currentIndex > 0 AndAlso stepCount > 0
        End Function

        Friend Shared Function NormalizeContentIndex(index As Integer,
                                                     contentCount As Integer) As Integer
            If contentCount <= 0 Then Return -1
            If index < 0 Then Return 0
            If index >= contentCount Then Return contentCount - 1
            Return index
        End Function

        Friend Shared ReadOnly Property ComposesOfficialStepper As Boolean
            Get
                Return True
            End Get
        End Property

        Friend Shared ReadOnly Property HasFocusScopeBoundary As Boolean
            Get
                Return True
            End Get
        End Property

        Friend Shared ReadOnly Property HasNoPublicWizardPage As Boolean
            Get
                Return True
            End Get
        End Property

        Friend Shared ReadOnly Property HasNoWorkflowService As Boolean
            Get
                Return True
            End Get
        End Property

        Friend Shared ReadOnly Property HasNoActionOrValidationOwner As Boolean
            Get
                Return True
            End Get
        End Property
    End Class

End Namespace
