开发者

What are the equivalents for DesignTimeVisibleAttribute and ToolBoxItemAttribute in WP7?

What are the equivalents for DesignTimeVisibleAttribute and ToolBoxItemAttribute in WP7?

We can use those two attri开发者_运维技巧butes 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??


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

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


IProvideAttributeTable

AttributeTableBuilder

ProvideMetadataAttribute

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜