diff --git a/src/Uno.UI.FluentTheme/Uno.UI.FluentTheme.csproj b/src/Uno.UI.FluentTheme/Uno.UI.FluentTheme.csproj index 5bb464386450..ff462b234286 100644 --- a/src/Uno.UI.FluentTheme/Uno.UI.FluentTheme.csproj +++ b/src/Uno.UI.FluentTheme/Uno.UI.FluentTheme.csproj @@ -38,6 +38,13 @@ + + + + + + + diff --git a/src/Uno.UI.Tests/Windows_UI_Xaml/Given_ThemeResource.cs b/src/Uno.UI.Tests/Windows_UI_Xaml/Given_ThemeResource.cs index ca8ab67235cc..c2e6f28f1b59 100644 --- a/src/Uno.UI.Tests/Windows_UI_Xaml/Given_ThemeResource.cs +++ b/src/Uno.UI.Tests/Windows_UI_Xaml/Given_ThemeResource.cs @@ -69,11 +69,13 @@ public async Task When_Theme_Changed_ResourceKey() var textBlock = page.ResourceKeyThemedTextBlock; - Assert.AreEqual(Colors.Black, (textBlock.Foreground as SolidColorBrush).Color); + // Dark text + Assert.IsTrue(((SolidColorBrush)textBlock.Foreground).Color.R < 100); await SwapSystemTheme(); - Assert.AreEqual(Colors.White, (textBlock.Foreground as SolidColorBrush).Color); + // Light text + Assert.IsTrue(((SolidColorBrush)textBlock.Foreground).Color.R > 200); } } @@ -88,11 +90,13 @@ public async Task When_Theme_Changed_ImplicitStyle() app.HostView.Children.Add(button); - Assert.AreEqual(Colors.Black, (button.Foreground as SolidColorBrush).Color); + // Dark text + Assert.IsTrue(((SolidColorBrush)button.Foreground).Color.R < 100); await SwapSystemTheme(); - Assert.AreEqual(Colors.White, (button.Foreground as SolidColorBrush).Color); + // Light text + Assert.IsTrue(((SolidColorBrush)button.Foreground).Color.R > 200); } }