
Thanks for the information. The following code crashes, do you know why?
App.xaml.cs OnStartUp
ImageProvider.Default.ChromaticAdaptationMode = ImageChromaticAdaptationMode.DarkThemes;
ImageProvider.Default.UseMonochromeInHighContrast = true;
ThemeManager.BeginUpdate();
try
{
ThemeManager.AreNativeThemesEnabled = true;
ThemeManager.CurrentTheme = "Light";
}
finally
{
ThemeManager.EndUpdate();
}
Window.xaml
<datagrid:ThemedDataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource DataGridColumnHeaderStyleKey}" >
<Setter Property="FontWeight" Value="Bold"/>
</Style>
</datagrid:ThemedDataGrid.ColumnHeaderStyle>
Exception
System.Windows.Markup.XamlParseException
Inner Exception 1:
Exception: Cannot find resource named 'DataGridColumnHeaderStyleKey'. Resource names are case sensitive.
On further investigation, I beleive the problem is I'm not specifying the namespace for DataGridColumnHeaderStyleKey. But, I can't find the right one. I have:
xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"
The following BasedOn attribute compiles and works with intellisense, but fails at runtime with the above exception
BasedOn="{DynamicResource {x:Static themes:DataGridResourceKeys.DataGridColumnHeaderStyleKey}}"
[Modified 10 hours ago]