在VS2010的菜单“工具”选项里,有个窗体设计器设置,工具箱AutoToolboxPopulate属性可控制是否将项目中自定义的控件添加到工具箱上,设置为false,则不添加。我现在就是不想让它自动添加,设置为false,但是对WPF的控件无效,项目中几百个WPF页面,每个页面都是继承Control,都被视为了控件添加到工具箱上,不但占地方,还影响速度,每次新增页面或修改页面,都会触发重新刷新工具箱的事件,导致VS操作很慢。
注:这个属性对WinForm控件的控制是有效的,只有WPF控件无效,这是VS2010的BUG吗?欢迎测试吐槽,来者有分。

解决方案 »

  1.   

    来了,我想知道winform控件,和wpf控件有啥区别
      

  2.   

    你可以参考下这个帖子看能否解决你的问题
    http://stackoverflow.com/questions/2725715/stop-silverlight-or-wpf-usercontrols-from-loading-in-the-toolbox
      

  3.   


    In VS2010, the Auto Populate Toolbox switch for XAML can be found under Tools/Options/Text Editor/XAML/Miscellaneous.If you wish to keep the Auto Populate enabled, you can decorate your usercontrol classes with the System.ComponentModel.DesignTimeVisibleAttribute which will allow you to specify if they appear or not in the designer.

    That works - thanks! – chadbr Jul 28 '10 at 3:15我粘贴过来了