Click to See Complete Forum and Search --> : WPF Control - How to hide a property @ design time.


pgrammer
May 8th, 2009, 09:27 PM
I am creating a custom control and I guess its a little different then a UserControl because I can't figure out how to hide a property from the Property Window. If this property is set at Design Time it will cause an exception. I only want it set with code.

Is this still possible?

gstercken
May 9th, 2009, 03:37 PM
Is this still possible?Yes, it is possible, by setting the BrowsableAttribute of your property to false:
[Browsable(false)]
public string MyProperty
{
get;
set;
}

Edit: Just making sure - you are talking about plain .NET properties, not dependency properties, right?