diff --git a/ModernWpf/ThemeManager.cs b/ModernWpf/ThemeManager.cs index 202c65f7..f164acd2 100644 --- a/ModernWpf/ThemeManager.cs +++ b/ModernWpf/ThemeManager.cs @@ -316,7 +316,12 @@ internal static void UpdateWindowActualTheme(Window window) var requestedTheme = GetRequestedTheme(window); if (requestedTheme == ElementTheme.Default) { - SetActualTheme(window, Current.ActualApplicationTheme.Value == ModernWpf.ApplicationTheme.Dark ? ElementTheme.Dark : ElementTheme.Light); + var actualAppTheme = Current.ActualApplicationTheme; + if (actualAppTheme.HasValue) + { + SetActualTheme(window, actualAppTheme.Value == ModernWpf.ApplicationTheme.Dark ? + ElementTheme.Dark : ElementTheme.Light); + } } else {