Is it possible to globally set Foreground for Border for internal controls? Similar to WPF TextBlock.Foreground
attached property. I tried this code, it doesn't work:
<Border.Resources>
<SolidColorBrush
x:Key="SystemControlForegroundAltMediumHighBrush"
Color="Black"
/>
<SolidColorBrush
x:Key="SystemControlForegroundAltHighBrush"
Color="Black"
/>
<SolidColorBrush
x:Key="SystemControlForegroundBaseMediumBrush"
Color="Black"
/>
<SolidColorBrush
x:Key="SystemControlForegroundBaseHighBrush"
Color="Black"
/>
<SolidColorBrush
x:Key="SystemControlForegroundBaseLowBrush"
Color="Black"
/>
<SolidColorBrush
x:Key="SystemControlForegroundBaseMediumHighBrush"
Color="Black"
/>
<SolidColorBrush
x:Key="SystemControlForegroundBaseMediumLowBrush"
Color="Black"
/>
</Border.Resources>
I also tried DefaultTextForegroundThemeBrush
and SystemColorWindowTextColor
P.S. I'll explain the reasons a little - I'm writing a utility to translate WPF xaml code into the equivalent UWP / WinUI, and I'm looking for an alternative without redefining styles (because internal controls can explicitly set their own). So far, the only solution I see is to explicitly set the Foreground property on all TextBlocks inside the Border if it's not set.