diff --git a/src/Wpf.Ui.Gallery/Controls/ControlExample.xaml b/src/Wpf.Ui.Gallery/Controls/ControlExample.xaml
index 4635a3247..2ab2a2c20 100644
--- a/src/Wpf.Ui.Gallery/Controls/ControlExample.xaml
+++ b/src/Wpf.Ui.Gallery/Controls/ControlExample.xaml
@@ -26,6 +26,7 @@
Grid.Row="0"
Margin="0,0,0,10"
FontTypography="BodyStrong"
+ Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{TemplateBinding HeaderText}"
Visibility="{TemplateBinding HeaderText,
Converter={StaticResource NullToVisibilityConverter}}" />
@@ -33,8 +34,8 @@
@@ -42,7 +43,6 @@
@@ -50,6 +50,7 @@
@@ -71,6 +71,7 @@
-
+
diff --git a/src/Wpf.Ui.Gallery/Views/Pages/DashboardPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/DashboardPage.xaml
index 0dbc9eb16..fe3db4866 100644
--- a/src/Wpf.Ui.Gallery/Views/Pages/DashboardPage.xaml
+++ b/src/Wpf.Ui.Gallery/Views/Pages/DashboardPage.xaml
@@ -1,4 +1,4 @@
-
@@ -154,8 +155,8 @@
Text="Dialogs & Flyouts"
TextWrapping="WrapWithOverflow" />
@@ -192,8 +193,8 @@
Text="Navigation"
TextWrapping="WrapWithOverflow" />
diff --git a/src/Wpf.Ui.Gallery/Views/Pages/Navigation/BreadcrumbBarPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/Navigation/BreadcrumbBarPage.xaml
index 5e393b6a7..609ae96b9 100644
--- a/src/Wpf.Ui.Gallery/Views/Pages/Navigation/BreadcrumbBarPage.xaml
+++ b/src/Wpf.Ui.Gallery/Views/Pages/Navigation/BreadcrumbBarPage.xaml
@@ -36,7 +36,6 @@
-
diff --git a/src/Wpf.Ui.Gallery/Views/Pages/SettingsPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/SettingsPage.xaml
index a901fbabd..6d28b61c7 100644
--- a/src/Wpf.Ui.Gallery/Views/Pages/SettingsPage.xaml
+++ b/src/Wpf.Ui.Gallery/Views/Pages/SettingsPage.xaml
@@ -14,9 +14,6 @@
IsDesignTimeCreatable=False}"
d:DesignHeight="450"
d:DesignWidth="800"
- ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
- ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
- Foreground="{DynamicResource TextFillColorPrimaryBrush}"
mc:Ignorable="d">
@@ -37,7 +34,7 @@
Text="App theme" />
@@ -93,7 +90,7 @@
diff --git a/src/Wpf.Ui.Gallery/Views/Pages/Windows/WindowsPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/Windows/WindowsPage.xaml
index 0016b7c20..0ba3a3af2 100644
--- a/src/Wpf.Ui.Gallery/Views/Pages/Windows/WindowsPage.xaml
+++ b/src/Wpf.Ui.Gallery/Views/Pages/Windows/WindowsPage.xaml
@@ -1,4 +1,4 @@
-
+
+
+
diff --git a/src/Wpf.Ui.Gallery/Views/Windows/EditorWindow.xaml b/src/Wpf.Ui.Gallery/Views/Windows/EditorWindow.xaml
index 4fc53bd9b..6ac2ae122 100644
--- a/src/Wpf.Ui.Gallery/Views/Windows/EditorWindow.xaml
+++ b/src/Wpf.Ui.Gallery/Views/Windows/EditorWindow.xaml
@@ -1,4 +1,4 @@
-
diff --git a/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs b/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs
index 73059c6f2..0e1de9098 100644
--- a/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs
+++ b/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs
@@ -3,6 +3,7 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
+using System.Runtime.CompilerServices;
using Wpf.Ui.Controls;
namespace Wpf.Ui.Appearance;
@@ -93,6 +94,10 @@ public static void Apply(
case ApplicationTheme.Dark:
themeDictionaryName = "Dark";
break;
+ case ApplicationTheme.HighContrast:
+ themeDictionaryName = "HighContrast";
+ backgroundEffect = WindowBackdropType.None; // We want to disable the background effect in high contrast mode
+ break;
}
var isUpdated = appDictionaries.UpdateDictionary(
@@ -165,6 +170,10 @@ public static void ApplySystemTheme(bool updateAccent)
{
themeToSet = ApplicationTheme.Dark;
}
+ else if (systemTheme is SystemTheme.HC1 or SystemTheme.HC2 or SystemTheme.HCBlack or SystemTheme.HCWhite)
+ {
+ themeToSet = ApplicationTheme.HighContrast;
+ }
Apply(themeToSet);
}
diff --git a/src/Wpf.Ui/Appearance/SystemTheme.cs b/src/Wpf.Ui/Appearance/SystemTheme.cs
index 55c0e217b..e04ecc7ee 100644
--- a/src/Wpf.Ui/Appearance/SystemTheme.cs
+++ b/src/Wpf.Ui/Appearance/SystemTheme.cs
@@ -30,6 +30,26 @@ public enum SystemTheme
///
Dark,
+ ///
+ /// High-contrast theme: Desert
+ ///
+ HCWhite,
+
+ ///
+ /// High-contrast theme: Acquatic
+ ///
+ HCBlack,
+
+ ///
+ /// High-contrast theme: Dusk
+ ///
+ HC1,
+
+ ///
+ /// High-contrast theme: Nightsky
+ ///
+ HC2,
+
///
/// First custom, kinda purple Windows 11 theme.
///
diff --git a/src/Wpf.Ui/Appearance/SystemThemeManager.cs b/src/Wpf.Ui/Appearance/SystemThemeManager.cs
index f17266068..d7eb9ec76 100644
--- a/src/Wpf.Ui/Appearance/SystemThemeManager.cs
+++ b/src/Wpf.Ui/Appearance/SystemThemeManager.cs
@@ -87,6 +87,26 @@ private static SystemTheme GetCurrentSystemTheme()
return SystemTheme.Dark;
}
+ if (currentTheme.Contains("hcblack.theme"))
+ {
+ return SystemTheme.HC1;
+ }
+
+ if (currentTheme.Contains("hcwhite.theme"))
+ {
+ return SystemTheme.HCWhite;
+ }
+
+ if (currentTheme.Contains("hc1.theme"))
+ {
+ return SystemTheme.HC1;
+ }
+
+ if (currentTheme.Contains("hc2.theme"))
+ {
+ return SystemTheme.HC2;
+ }
+
if (currentTheme.Contains("themea.theme"))
{
return SystemTheme.Glow;
diff --git a/src/Wpf.Ui/Controls/BreadcrumbBar/BreadcrumbBar.xaml b/src/Wpf.Ui/Controls/BreadcrumbBar/BreadcrumbBar.xaml
index 904f1d290..544f3f8f0 100644
--- a/src/Wpf.Ui/Controls/BreadcrumbBar/BreadcrumbBar.xaml
+++ b/src/Wpf.Ui/Controls/BreadcrumbBar/BreadcrumbBar.xaml
@@ -1,4 +1,4 @@
-
diff --git a/src/Wpf.Ui/Controls/Calendar/Calendar.xaml b/src/Wpf.Ui/Controls/Calendar/Calendar.xaml
index b26d8bf05..b4948930d 100644
--- a/src/Wpf.Ui/Controls/Calendar/Calendar.xaml
+++ b/src/Wpf.Ui/Controls/Calendar/Calendar.xaml
@@ -64,7 +64,7 @@
RadiusY="1"
Visibility="Collapsed">
-
+
diff --git a/src/Wpf.Ui/Controls/Card/Card.xaml b/src/Wpf.Ui/Controls/Card/Card.xaml
index 5774aab0b..7252afffa 100644
--- a/src/Wpf.Ui/Controls/Card/Card.xaml
+++ b/src/Wpf.Ui/Controls/Card/Card.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -99,24 +91,26 @@
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/src/Wpf.Ui/Controls/CardColor/CardColor.xaml b/src/Wpf.Ui/Controls/CardColor/CardColor.xaml
index 870e657cc..6c1cd6cd3 100644
--- a/src/Wpf.Ui/Controls/CardColor/CardColor.xaml
+++ b/src/Wpf.Ui/Controls/CardColor/CardColor.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -95,21 +87,22 @@
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/src/Wpf.Ui/Controls/CardExpander/CardExpander.xaml b/src/Wpf.Ui/Controls/CardExpander/CardExpander.xaml
index 9296d75b3..25d1836db 100644
--- a/src/Wpf.Ui/Controls/CardExpander/CardExpander.xaml
+++ b/src/Wpf.Ui/Controls/CardExpander/CardExpander.xaml
@@ -84,17 +84,9 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -175,7 +167,7 @@
-
-
-
-
+
+
+
+
diff --git a/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml b/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml
index fb656e996..99fb3b58f 100644
--- a/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml
+++ b/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml
@@ -91,11 +91,7 @@
-
-
-
-
-
+
@@ -115,7 +111,10 @@
CornerRadius="{TemplateBinding Border.CornerRadius}"
SnapsToDevicePixels="True">
-
+
+
diff --git a/src/Wpf.Ui/Controls/Expander/Expander.xaml b/src/Wpf.Ui/Controls/Expander/Expander.xaml
index 2333f299e..a831d75f8 100644
--- a/src/Wpf.Ui/Controls/Expander/Expander.xaml
+++ b/src/Wpf.Ui/Controls/Expander/Expander.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -145,7 +137,7 @@
-
-
-
-
+
+
+
-
+
diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewBasePaneButtonStyle.xaml b/src/Wpf.Ui/Controls/NavigationView/NavigationViewBasePaneButtonStyle.xaml
index 89b647241..648d2b787 100644
--- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewBasePaneButtonStyle.xaml
+++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewBasePaneButtonStyle.xaml
@@ -8,11 +8,7 @@