No creation of a WPF window in a DLL project?

前端 未结 4 1891
梦毁少年i
梦毁少年i 2020-12-02 16:56

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

4条回答
  •  醉梦人生
    2020-12-02 17:17

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

    Add New Item->WPF->User Control

    In XAML:

    Change tag as

    In CS:

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

提交回复
热议问题