Apr 092012

In Visual Studio 2010, depending on the project type you get different options when you want to add new items to a project. If you have created a class library and later you figure out that you want to add WPF custom controls, you will need to change the project so that it supports this functionality.

Changing the project type is an easy task. You need to open up the .csproj file in a text editor and add the following tag under the <PropertyGroup> element:


You will also need to add the following WPF references with Visual Studio:

  • PresentationCore
  • PresentationFramework
  • System.Xaml
  • WindowsBase

Once everything is done, you can add a new CustomControl to the project:

image thumb Converting a class library to WPF control library

  • K Rol

    Still working with Visual Studio 2015