How to build library with WPF forms
Choose WPF Custom Control Library
or WPF User Control Library
when creating/adding new project to your solution.
Change the build action of your UserControl
from ApplicationDefinition
to Page
.
Remove the App.xaml and App.xaml.cs in your WPF Project. Then you will be able to run the project with an output type of Class Library.