No creation of a WPF window in a DLL project?

Viewed 34297

Is there a reason why Visual Studio won't let me create a WPF window in a DLL project?

I "solved" it by creating a window in an Application Project and copying it to my DLL project. I also found that I could just create a UserControl and change the base class to "Window".

But if I had to do it this way, it's maybe because I shouldn't do it...

4 Answers

You can try adding new WPF User Control Item and change that to Window.

Add New Item->WPF->User Control

In XAML:

Change <UserControl> tag as <Window>

In CS:

Change base class from System.Windows.Controls.UserControl to System.Windows.Window.

Related