Update Brush.Parse() to Handle all Color Formats (#19526)

* Add unit test for all color format Brush parsing

* Support parsing all known color formats in Brush.Parse()

* Update property syntax

* Remove unnecessary usings

* Use an actual hex color

* Fix new brush test

* Switch order of brush parsing so known color optimizations are used

* Add more documentation comments to KnownColors

* Fix displayed text in BorderPage

InnerBorderEdge not InnerBorder
This commit is contained in:
robloo
2025-08-24 15:46:04 -04:00
committed by GitHub
parent 51443cb089
commit 6c33fe192a
4 changed files with 96 additions and 24 deletions
+6 -6
View File
@@ -20,26 +20,26 @@
<Border Background="{DynamicResource SystemAccentColorDark1}"
BorderBrush="{DynamicResource SemiTransparentSystemAccentBrush}"
BackgroundSizing="CenterBorder"
BorderThickness="8"
BorderThickness="8"
Padding="12">
<TextBlock>Background And CenterBorder</TextBlock>
</Border>
<Border Background="{DynamicResource SystemAccentColorDark1}"
BorderBrush="{DynamicResource SemiTransparentSystemAccentBrush}"
BackgroundSizing="InnerBorderEdge"
BorderThickness="8"
BorderThickness="8"
Padding="12">
<TextBlock>Background And InnerBorder</TextBlock>
<TextBlock>Background And InnerBorderEdge</TextBlock>
</Border>
<Border Background="{DynamicResource SystemAccentColorDark1}"
BorderBrush="{DynamicResource SemiTransparentSystemAccentBrush}"
BackgroundSizing="OuterBorderEdge"
BorderThickness="8"
BorderThickness="8"
Padding="12">
<TextBlock>Background And OuterBorderEdge</TextBlock>
</Border>
<Border BorderBrush="{DynamicResource SystemAccentColor}"
BorderThickness="4"
BorderThickness="4"
CornerRadius="8"
Padding="16">
<TextBlock>Rounded Corners</TextBlock>
@@ -56,6 +56,6 @@
<Image Source="/Assets/maple-leaf-888807_640.jpg" Stretch="UniformToFill" />
</Border>
<TextBlock Text="Border with Clipping" HorizontalAlignment="Center" />
</StackPanel>
</StackPanel>
</StackPanel>
</UserControl>