Reputation: 23833
I have the following XAML for a custom DataGrid
:
<Controls:ResourceDataGrid
x:Name="resourceDataGrid"
AutoGenerateColumns="false"
Style="{StaticResource MetroDataGrid}"
ItemsSource="{Binding Path=Resources,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged,
IsAsync=True}"
...
AttachedCommand:CommandBehavior.Event="CellEditEnding"
AttachedCommand:CommandBehavior.Command="{Binding DynamicColumnTargetChangedCommand}">
...
</Controls:ResourceDataGrid>
I am styling the control according to MahAppsMetro and the grid looks great. However, when I change the applications 'theme'/'accent' all windows change color and all MahAppsMetro controls also change but the DataGrid
that I have detailed above does not.
The DataGrid
is styled as a MetroDataGrid
, so why isn't this control being updated, and what do I have to do to get it to update the 'theme'/'accent' color for this control?
Thanks for your time.
Upvotes: 0
Views: 499
Reputation: 69979
Themes only work on CustomControl
s. In order to provide different 'skins' for controls, you need to have a CustomControlLibrary
project with a XAML file named generic.xaml
.
You can find a short basic description in the Themes/generic.xaml page on Martins' 10 blog, or if you prefer more depth, you can find a complete description in the Control Authoring Overview page on MSDN.
Upvotes: 2