Silverlight 用户控件未出现在工具箱中
我从 VS 2010 中的 Silverlight 业务应用程序项目开始,并添加了两个用户控件。如果我在主窗体的代码后面创建任一用户控件的实例并将它们添加到页面,它们将正确显示。但是,它们没有出现在工具箱中。
当我使用工具箱的“我的项目控件”部分的“Silverlight 组件”选项卡中的“选择项目”菜单选项时,我看到我的一个用户控件出现在列表中并被选中(但没有出现在列表中) Toolbox),而其他用户控件根本不会出现在列表中。
我该如何诊断/修复这种情况?
I started with a Silverlight Business Application project in VS 2010 and added two user controls. If I create an instance of either user control in the code behind of the main form and add them to the page, they appear properly. However, they are not showing up in the Toolbox.
When I use the "Choose Items" menu option from the Toolbox's MyProject Controls section, Silverlight Components tab, I see that one of my user controls appears in the list and is checked (but does not appear in the Toolbox), while the other user control does not appear in the list at all.
How can I diagnose/repair the situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的用户控件没有默认构造函数,而是采用带有默认值的参数的构造函数。
显然,工具箱需要一个默认构造函数(不仅仅是可以在没有任何显式参数的情况下调用的构造函数)。
My user controls did not have a default constructor, but rather a constructor that took a parameter with a default value.
Apparently the Toolbox requires a default constructor (not just a constructor that can be invoked without any explicit parameters).