Change the project type from class library to WPF User control library

You need to add the following to your project file;

Under the <FileAlignment> element

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

You may also want to insure you've the following references added within the <ItemGroup> element;

  • <Reference Include="WindowsBase" />
  • <Reference Include="PresentationCore" />
  • <Reference Include="PresentationFramework" />
  • <Reference Include="System.Xaml" />

it is not an easy change through the project properties (alt+enter). you need to manually edit the .proj file in an editor ( say notepad / textpad) when you compare a classlibrary project and a WPF Usercontrol library projects .proj file you will find the difference in them is through the nodes in the node.

you need to add ProjectTypeGuids , WarningLevel and TargetFrameworkProfile . it is my understanding, they started to dictate a project type through the PRojectTypeGuids node! which is really cool!

create a class library project and a WPF usercontrol library project and open the .proj files in an editor to compare, you should be able to figure out what i am talking here!

Tags:

Wpf

Prism