How to implement virtual static properties?

前端 未结 3 1484
粉色の甜心
粉色の甜心 2020-11-30 13:51

As far as I know C# doesn\'t support virtual static properties. How to implement such a behavior in C#?

I want to archive that all derived

3条回答
  •  心在旅途
    2020-11-30 14:39

    Simply put, you can't, so I humbly suggest that you leave it and try something else.

    Please see the answer in this SO post. If you could implement such a feature you would have serious problems with inheritance.

    Been there, done that. After I came to my senses again, I went for a regular inheritance approach. I think you should probably do the same.

提交回复
热议问题