Insert the WPF Resource Dictionary into the class library through Visual Studio 2010

I have a class library and you want to change the type so that I can also add WPF resource dictionaries. I added WPF links, and also tried to synchronize the AssemblyInfo.cs file with a project that allows me to add such resource files, but to no avail.

If I use the add-new dialog from Visual Studio, the template for WPF resource dictionaries is not available. If I create the file manually and then reference it, everything works fine.

How can I change my project to a WPF user control library project so that Visual Studio can add WPF resource dictionaries. Or are there any flaws or flaws, so I should not do this and it is better to create a new project file?

+6
source share
1 answer

It seems to be defined in the csproj file. If I add the following line to the PropertyGroup-Section, I can do what I'm looking for:

<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> 

note
Although I found the location where definiton is located, I did not use a modified version of csproj-File. I created a new project with the desired settings. It seems that there are many additional project parameters between the management library and the class library, and perhaps only adding the above commands can lead to unexpected project / solution behavior.

+6
source

Source: https://habr.com/ru/post/910193/


All Articles