I've put a few good hours into this.. I'm 开发者_如何学JAVAunable to see the various styles I have defined in a global Resource dictionary. The external file is called Styles.xaml. What am I missing?
There are a few things to consider using MergedDictionaries.
First you should set the BuildAction of the ResourceDictionary (Styles.xaml) to Resource or Content (I tried it with Resource).
Second in your App.xaml do not define a Key for the ResourceDictionary (remove x:Key="ButtonStyles")
Then put all other resources in your Application.Resources in the ResourceDictionary.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Assets/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<CCE_2009_Client_ViewModels:ViewModelLocator x:Key=ViewModelLocatorDataSource/>
<!-- Any additional resources -->
</ResourceDictionary>
</Application.Resources>
After all this is done then you should select the Style in the Properties Window.
Do you have referenced CCE_2009.Client
assembly (project) in the project you want to use this style?
If not this can be a fix for your problem.
精彩评论