Skip to content

Conversation

@ghostp13409
Copy link
Contributor

Related to #1380

Let me know if anything is breaking :)

@Keboo Keboo added this to the 5.2.0 milestone Dec 27, 2024
Copy link
Member

@Keboo Keboo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really great work. One small comment then we can merge it.

Comment on lines 78 to 90
Param ($xamlString, $file, $xamlPath)
[xml]$xaml = $xamlString
$xaml.ResourceDictionary.Style |
Foreach-Object {
$xamlLines = Get-Content $xamlPath
$lineNum = 1
$xaml.ResourceDictionary.Style |
Foreach-Object {
Write-Output $_
# Get line number by Key or TargetType
$styleLineNumber = $null
$searchKey = if ($_.Key) { $_.Key } else { $_.TargetType }

for ($i = 0; $i -lt $xamlLines.Length; $i++) {
if ($xamlLines[$i] -match [regex]::Escape($searchKey)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think $xamlPath is not needed as I believe you already have the content in $xamlString though this variable could probably be renamed to be $xamlLines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I've made the changes.

refactored xamlString to xamlLines and removed xamlPath var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants