WP7 中 DesignTimeVisibleAttribute 和 ToolBoxItemAttribute 的等效项是什么?

发布于 2024-11-15 15:16:14 字数 210 浏览 6 评论 0原文

WP7 中 DesignTimeVisibleAttribute 和 ToolBoxItemAttribute 的等效项是什么?

我们可以在设计时使用这两个属性来显示/隐藏某个控件,但是WP7的FCL不包含它们。

替代解决方案是什么?

谢谢

简而言之:如何从 Visual Studio 的工具箱中隐藏 WP7 自定义控件?

What are the equivalents for DesignTimeVisibleAttribute and ToolBoxItemAttribute in WP7?

We can use those two attributes to show/hide a certain control in design time, but the WP7's FCL does not include them.

What is the alternative solution?

Thanks

In short terms: how to hide a WP7 custom control from the toolbox of Visual Studio??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆蝶 2024-11-22 15:16:14

您可以尝试将此代码放入自定义控件的构造函数中:

if (DesignerProperties.IsInDesignTool)
{
    this.Visibility = Visibility.Hidden;
}

You could try putting this code in the constructor of your custom control:

if (DesignerProperties.IsInDesignTool)
{
    this.Visibility = Visibility.Hidden;
}
看轻我的陪伴 2024-11-22 15:16:14

IProvideAttributeTable

AttributeTableBuilder

ProvideMetadataAttribute

只需搜索这三个类,这就是我修复它的方法。

IProvideAttributeTable

AttributeTableBuilder

ProvideMetadataAttribute

Just search for these three classes, that's how I fixed it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文