Hi,
What I suggest is, you keep the style within the DataGridControl.Resources, but link the ControlTemplate to a StaticResource that can be held in an external Resource file.
< xcdg : DataGridControl.Resources >
<Style TargetType="ScrollBar">
<Setter Property="Template" Value="{StaticResource myScrollBarTemplate}"/>
</Style>
</xcdg:DataGridControl.Resources>
And you can define myScrollBarTemplate in any resource file that is being refernced in this class
< ControlTemplate x : Key ="myScrollBarTemplate">
<!-- Define your template here -->
</ ControlTemplate >
This way you can define your myScrollBarTemplate differently in different resource files based on the selection of theme.
The grid in-fact continue to use myScrollBarTemplate to render its scrollbar, but the definition of myScrollBarTemplate keeps on changing based on the theme.
I've tested it at my end before posting, hope it will work for you also.
Abdullah Ansari
Senior Software Engineer
Outworks Solutions Private Limited
Everything is okay in the end. If its not okay, then its not the end.