❔ 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 McCheese15mo ago
I know this isn't the answer you want, but don't use the designer.
Will Pittenger
Will PittengerOP15mo ago
Doesn't matter as other developers might. Besides, I want the XAML compiler to disallow that property.
Accord
Accord15mo 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.
Want results from more Discord servers?
Add your server