开发者

Add A New Property To A Third Party Control

开发者 https://www.devze.com 2023-01-14 23:17 出处:网络
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.

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 ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消