private/styles/Set-ComboBoxStyle.ps1

function Set-ComboBoxStyle {
    <#
    .SYNOPSIS
        Styles a ComboBox with theme-aware colors.
    #>

    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]
        [System.Windows.Controls.ComboBox]$ComboBox
    )

    $styleApplied = $false
    try {
        $style = [PsUi.ThemeEngine]::FindStyleResource('ModernComboBoxStyle')
        if ($null -ne $style) {
            $ComboBox.Style = $style
            $styleApplied = $true
        }
    }
    catch {
        Write-Verbose "Failed to apply ModernComboBoxStyle: $_"
    }

    # Warn if XAML style not found (indicates ThemeEngine initialization issue)
    if (!$styleApplied) {
        Write-Warning "XAML style 'ModernComboBoxStyle' not found. Ensure ThemeEngine.LoadStyles() was called."
    }

    Set-UiWheelRouting -Control $ComboBox

    try {
        [PsUi.ThemeEngine]::RegisterElement($ComboBox)
    }
    catch {
        Write-Verbose "Failed to register ComboBox with ThemeEngine: $_"
    }
}