I am using MaterialDesignInXAML in WPF using C# (.net Core 3.1). https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit
How do I set it to dark mode for the design time editor?
I set my main window to have:
TextElement.Foreground="{DynamicResource MaterialDesignForeground}"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
App.xaml has:
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
There is no code behind.
I know I can modify the Theme at runtime, that is not an issue. But I know there is a way to modify it at design time. (I want my Visual Studio window to show the dark background etc when editing.)
When running MaterialDesignToolKit.Full (from https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/releases) The MaterialDesignDemo.
It has dark mode enabled in the editor. I've been looking through it but can't seem to spot why.
I'm sure it's something simple but the app.xaml seems to be the same. I'm missing something obviously.
Any ideas?
You should set the
BaseThemeproperty toDarkin yourApp.xamlto apply the dark theme: