Main アセンブリにマージされたリソース ディクショナリがありますApp.xaml
。このリソース ディクショナリは、Common と PresentationLayer という別のアセンブリのさまざまなリソース ディクショナリを結合します。
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Common;component/Themes/Button.xaml"/>
<ResourceDictionary Source="/PresentationLayer;component/DataTemplates/AppointmentsDataTemplates.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
実行時に、リソース ディクショナリのスタイルがコントロールに正しく適用されます。ただし、設計時にスタイルが適用されず、Visual Studio 2012 で次のエラーが発生し続けます。
An error occurred while finding the resource dictionary "/Common;component/Themes/Button.xaml".
そして警告:
The resource "BannerButton" could not be resolved.
この投稿に出くわしましたが、Build Action が Resource に設定されていても問題は解決しません。また、Visual Studio 2010 または Expression Blend 4 で実行している場合、この問題は発生しませんでした。メイン アセンブリは確実に Common アセンブリへの参照を保持しており、Pack URI は変更していません。