Home > Enterprise >  Using of system colors in WinUI3 without DynamicResource - is it possible?
Using of system colors in WinUI3 without DynamicResource - is it possible?

Time:09-25

I am porting some XAML from WPF to WinUI3. As far as I understand for now I can't use DynamicResource in WinUI3, but is there any workaround to use system color like this one in WPF:

<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.HighlightColorKey}}"/>

CodePudding user response:

You could use the corresponding theme resource:

<SolidColorBrush Color="{ThemeResource SystemColorHighlightColor}"/>
  • Related