From f771b28eec9d34f77af0779cbdd7e78557759216 Mon Sep 17 00:00:00 2001 From: Sia Gupta Date: Thu, 1 Aug 2024 17:26:58 +0530 Subject: [PATCH] updated ThemeGenerator.Fluent.ps1 script --- .../Generator/ThemeGenerator.Fluent.ps1 | 73 +++++++++---------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 b/src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 index 2eba7298d7f..bc0cc057c20 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 +++ b/src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 @@ -1,46 +1,45 @@ -[CmdletBinding(PositionalBinding=$false)] -Param( - [string][Alias('c')]$themeColor = "Light" -) +$themeColors=@("Light", "Dark", "HC"); $currentDir = Get-Location $fluentThemeDir = Join-Path $currentDir "..\PresentationFramework.Fluent\" -$outFilePath = Join-Path $fluentThemeDir "Themes\Fluent.$themeColor.xaml" - $styleFilesDir = Join-Path $fluentThemeDir "Styles" $resouceFilesDir = Join-Path $fluentThemeDir "Resources" -$themeColorFilePath = Join-Path $resouceFilesDir "Theme\$themeColor.xaml" - -[xml]$combinedXaml = ' - ' -foreach ($file in Get-ChildItem $resouceFilesDir -Filter "*.xaml") { - if($file.BaseName -eq "Fluent") { - continue +foreach($themeColor in $themeColors) +{ + $outFilePath = Join-Path $fluentThemeDir "Themes\Fluent.$themeColor.xaml" + $themeColorFilePath = Join-Path $resouceFilesDir "Theme\$themeColor.xaml" + + [xml]$combinedXaml = ' + ' + + foreach ($file in Get-ChildItem $resouceFilesDir -Filter "*.xaml") { + if($file.BaseName -eq "Fluent") { + continue + } + [xml]$currentXaml = Get-Content $file.FullName + + $combinedXaml.ResourceDictionary.InnerXml += $currentXaml.ResourceDictionary.InnerXml + } + + [xml]$themeColorXaml = Get-Content $themeColorFilePath + $combinedXaml.ResourceDictionary.InnerXml += $themeColorXaml.ResourceDictionary.InnerXml + + foreach ($file in Get-ChildItem $styleFilesDir -Filter "*.xaml") { + [xml]$currentXaml = Get-Content $file.FullName + $combinedXaml.ResourceDictionary.InnerXml += $currentXaml.ResourceDictionary.InnerXml } - [xml]$currentXaml = Get-Content $file.FullName - - $combinedXaml.ResourceDictionary.InnerXml += $currentXaml.ResourceDictionary.InnerXml -} - -[xml]$themeColorXaml = Get-Content $themeColorFilePath -$combinedXaml.ResourceDictionary.InnerXml += $themeColorXaml.ResourceDictionary.InnerXml - -foreach ($file in Get-ChildItem $styleFilesDir -Filter "*.xaml") { - [xml]$currentXaml = Get-Content $file.FullName - - $combinedXaml.ResourceDictionary.InnerXml += $currentXaml.ResourceDictionary.InnerXml -} -([xml]$combinedXaml).Save($outFilePath) \ No newline at end of file + ([xml]$combinedXaml).Save($outFilePath) +} \ No newline at end of file