Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I must either be dumb or blind. I have created a WPF application. Along with that application, I created a library. In the same solution and the library is referenced in the application project. The library is to be used as a theming library. The styles are shown during runtime of the application. However, during design time, Most styles are shown. However, the style for the Windows are not shown. I am using Visual Studio 2019.

What I have tried:

I have tried adding the DesignTimeResources.xaml file to the Properties directory and set the ItemGroup in the csproj file as was suggested on other sites. The styles still do not show for the Window.
Posted
Updated 4-Nov-21 10:32am

1 solution

When you reference a resource from outside the file where it is implemented, you have to use {DynamicResource} to reference it. You also have to create a ResourceDictionary in your xaml.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900