Option Strict On
Option Explicit On

Imports System
Imports System.ComponentModel
Imports System.Globalization
Imports Nexamas.UI.Architecture
Imports Nexamas.UI.Components
Imports Nexamas.UI.Composition
Imports Nexamas.UI.General
Imports Nexamas.UI.Layout
Imports Nexamas.UI.Rendering
Imports Nexamas.UI.Theming
Imports Nexamas.UI.Values
Imports SkiaSharp

Namespace Nexamas.UI.Controls

    Partial Public NotInheritable Class MASOperationProgressBox
#Region "Child Construction"

        Private Shared Function CreateTitleLabel(text As String) As MASLabel
            Dim label As New MASLabel(MASOperationProgressBoxPolicy.NormalizeTitleText(text))
            label.LabelVariant = MASLabelVariant.Subtitle
            label.TextRole = MASLabelTextRole.Primary
            label.HorizontalAlignment = MASHorizontalAlignment.Left
            label.VerticalAlignment = MASVerticalAlignment.Center
            label.MultiLine = False
            label.WordWrap = False
            label.FontWeight = 600
            Return label
        End Function

        Private Shared Function CreateStatusLabel(text As String) As MASLabel
            Dim label As New MASLabel(MASOperationProgressBoxPolicy.NormalizeStatusText(text))
            label.LabelVariant = MASLabelVariant.Caption
            label.TextRole = MASLabelTextRole.Muted
            label.HorizontalAlignment = MASHorizontalAlignment.Left
            label.VerticalAlignment = MASVerticalAlignment.Center
            label.MultiLine = False
            label.WordWrap = False
            Return label
        End Function

        Private Shared Function CreatePercentLabel() As MASLabel
            Dim label As New MASLabel()
            label.LabelVariant = MASLabelVariant.Caption
            label.TextRole = MASLabelTextRole.Primary
            label.HorizontalAlignment = MASHorizontalAlignment.Center
            label.VerticalAlignment = MASVerticalAlignment.Center
            label.MultiLine = False
            label.WordWrap = False
            label.FontWeight = 600
            Return label
        End Function

        Private Shared Function CreateInnerProgressBar(percentLabel As MASLabel) As MASProgressBar
            Dim progress As New MASProgressBar()
            progress.Minimum = 0.0R
            progress.Maximum = 100.0R
            progress.Value = 0.0R
            progress.VisualState = MASProgressBarState.Normal
            progress.Label = percentLabel
            progress.LabelPlacement = MASProgressBarLabelPlacement.InsideCenter
            progress.AutoArrangeLabelAlignment = True
            progress.FrameMode = MASProgressBarFrameMode.None
            Return progress
        End Function

#End Region
    End Class

End Namespace
