Add A New Property To A Third Party Control
I am working with dev ex controls and on a menu bar item there isnt a property for setting the button to Visible or not Not Visible.
Can you add properties like this to pre made controls? If so how would you 开发者_运维百科do it?
If allowed (control class not marked as sealed), you should create another control that inherits from your dev ex control in order to add extra properties.
An alternative if you can use inheritance.
You can create extension methods that will act like properties.
GetCompanyName()
SetCompanyName()
After all, properties are language shortcut to create them at compilation ;)
精彩评论