I have a few user controls that need to be shared between multiple Silverlight 4 project. I am creating a new project that defines those controls in a namespace called [appname].[UI]
I want to create a new Stylesheet for all these controls within the project, however I don’t know how to reference the styles at design time (I can reference them via the style=”” attribute, but they never get applied).
More over I do know that the application has to “Register” the style sheet as part of its resources. Is there a way to do so from within my UI project?
Am I wrong with my assumptions or is there any work around these issues?
To register, add the
<MergedDictionary>tag in your App.xaml<ResourceDictionary>entry. This will allow the application to access your styles, like so:Once they are registered, the Style=”” attribute should work, but if it doesn’t, post the code. It might be an error in the XAML.