开发者

What are the equivalents for DesignTimeVisibleAttribute and ToolBoxItemAttribute in WP7?

开发者 https://www.devze.com 2023-03-12 09:55 出处:网络
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 F

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

精彩评论

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

关注公众号