❔ In a derived WPF control, how do you hide properties from the base class?

I have a UserControl. UserControl, of course, exposes a property called Content. But if the parent of my control tries to set Content, you get mysterious error messages that are tough to understand. So I want to hide those properties. But how? [EditorBrowsable] doesn't work on properties. [Browsable] does, but has no effect on the properties window in the designer. I tried putting warnings in my own [Description], but it seems the WPF designer is ignoring my property. So private on the property has no effect either.
3 Replies
Mayor McCheese
Mayor McCheese9mo ago
I know this isn't the answer you want, but don't use the designer.
Will Pittenger
Will Pittenger9mo ago
Doesn't matter as other developers might. Besides, I want the XAML compiler to disallow that property.
Accord
Accord9mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.