mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-17 10:17:44 -06:00
Move the Xaml Generation of the panels to the main script
This commit is contained in:
parent
827398b007
commit
225441b804
24
Compile.ps1
24
Compile.ps1
@ -71,29 +71,21 @@ Get-ChildItem .\config | Where-Object {$PSItem.Extension -eq ".cfg"} | ForEach-O
|
||||
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$(Get-Content $PSItem.FullName)'"))
|
||||
}
|
||||
|
||||
Write-Progress -Activity "Compiling" -Status "Writing xaml"
|
||||
$xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''")
|
||||
|
||||
# Dot-source the Get-TabXaml function
|
||||
. .\functions\private\Get-TabXaml.ps1
|
||||
|
||||
Write-Progress -Activity "Compiling" -Status "Building: Xaml " -PercentComplete 75
|
||||
$appXamlContent = Get-TabXaml "applications" 5
|
||||
$tweaksXamlContent = Get-TabXaml "tweaks"
|
||||
$featuresXamlContent = Get-TabXaml "feature"
|
||||
|
||||
|
||||
Write-Progress -Activity "Compiling" -Status "Adding: Xaml " -PercentComplete 90
|
||||
# Replace the placeholder in $inputXML with the content of inputApp.xaml
|
||||
$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent
|
||||
$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
|
||||
$xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent
|
||||
|
||||
$script_content.Add($(Write-output "`$inputXML = '$xaml'"))
|
||||
|
||||
$script_content.Add($(Get-Content .\scripts\main.ps1))
|
||||
|
||||
if ($Debug){
|
||||
Write-Progress -Activity "Compiling" -Status "Writing debug files" -PercentComplete 95
|
||||
# Dot-source the Get-TabXaml function
|
||||
. .\functions\private\Get-TabXaml.ps1
|
||||
|
||||
$appXamlContent = Get-TabXaml "applications" 5
|
||||
$tweaksXamlContent = Get-TabXaml "tweaks"
|
||||
$featuresXamlContent = Get-TabXaml "feature"
|
||||
|
||||
$appXamlContent | Out-File -FilePath ".\xaml\inputApp.xaml" -Encoding ascii
|
||||
$tweaksXamlContent | Out-File -FilePath ".\xaml\inputTweaks.xaml" -Encoding ascii
|
||||
$featuresXamlContent | Out-File -FilePath ".\xaml\inputFeatures.xaml" -Encoding ascii
|
||||
|
@ -52,6 +52,15 @@ $sync.runspace.Open()
|
||||
|
||||
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window'
|
||||
|
||||
# Dynamically Generate the xaml code for the different panels at Runtime
|
||||
$appXamlContent = Get-TabXaml "applications" 5
|
||||
$tweaksXamlContent = Get-TabXaml "tweaks"
|
||||
$featuresXamlContent = Get-TabXaml "feature"
|
||||
|
||||
$inputXML = $inputXML -replace "{{InstallPanel_applications}}", $appXamlContent
|
||||
$inputXML = $inputXML -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
|
||||
$inputXML = $inputXML -replace "{{InstallPanel_features}}", $featuresXamlContent
|
||||
|
||||
if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) {
|
||||
if (Invoke-WinUtilGPU -eq $True) {
|
||||
$ctttheme = 'Matrix'
|
||||
|
Loading…
Reference in New Issue
Block a user