无法创建类型的实例
问题描述:
我已经创建了一个UserControl Popup窗口,并将该xaml文件称为另一个文件.导入了名称空间.
当我尝试构建此项目时,在以下给定代码处出现错误:
I have created a UserControl Popup window and called that xaml file into another file. Imported the namespace.
When I am trying to build this project an error at this below given code:
<Popup x:Name="POP" IsOpen="False" PlacementTarget="{Binding}" Placement="Center" AllowsTransparency="True">
<a:PopUpWindow x:Name="pp" />
</Popup>
" <a:PopUpWindow x:Name="pp" /> " : Could not create an instance of type ''PopUpWindow''.
Error at " <a:PopUpWindow x:Name="pp" /> " : Could not create an instance of type ''PopUpWindow''.
答
时出错,您确定这是编译器错误吗?这可能是智能错误,还是设计人员抛出了设计时间错误?
另外,该类型是否具有公共默认构造函数?
Are you sure this is a compiler error? It may be an intellisense error, or the designer throwing up a design time error?
Alternatively, does that type have a public default constructor?