1

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??

Cui Pengfei 崔鹏飞
  • 8,017
  • 6
  • 46
  • 87
  • Not sure if this is the answer you're looking for, or you have to use attributes, but you can simply click on the `Hide` icon next to your control in the `Objects and Timeline` window. `DesignTimeVisibleAttribute` is a SL4 feature. – keyboardP Jun 14 '11 at 02:42
  • thanks, but I need to hide it in the designer of Visual Studio. – Cui Pengfei 崔鹏飞 Jun 14 '11 at 02:47

2 Answers2

0

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

if (DesignerProperties.IsInDesignTool)
{
    this.Visibility = Visibility.Hidden;
}
Richard Szalay
  • 83,269
  • 19
  • 178
  • 237
0

IProvideAttributeTable

AttributeTableBuilder

ProvideMetadataAttribute

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

Cui Pengfei 崔鹏飞
  • 8,017
  • 6
  • 46
  • 87