Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1336
Putting Styles in a MergedDictionary?
posted

Hi all,

I'm having trouble with something that I'm sure should be simple... not sure if there is a problem or if I'm going mad!  I have defined a style for a DataRecordCellArea (just sets the BackgroundHover property), within the resources of a XamDataGrid (defined in Xaml).  This works fine.  The problem arises when moving the same style into a separate ResourceDictionary file.  I have changed the Resources of the XamDataGrid to the following:

<ResourceDictionary>     

 

<ResourceDictionary.MergedDictionaries> 

 

<ResourceDictionary Source="/Daves Tests;component/Themes/test.xaml" /> 

 

</ResourceDictionary.MergedDictionaries>

 

</ResourceDictionary>

...and moved the style within test.xaml.  However, the style is ignored in this case; it only works when placed directly in the resources section of the XamDataGrid itself.

 

I tried the same test simply using a button and having a style change its background – in this case it works when the style is placed directly within the buttons resources, or within a separate resource dictionary... am I missing something?

 

Cheers,

Dave

Parents Reply Children
No Data