-
Notifications
You must be signed in to change notification settings - Fork 646
Extendibility of elements #1258
Description
The problem is modifying internal behaviour of an element without writing a completely new one.
Let's take as an example SelectionPrompt. I wanted to add additional input handling to handle numbers from input as a selection index. Right now, there is no way to do that, as the class itself is sealed, and all inner classes are internal, so I cannot even create a simple copy of the class but need to copypaste the whole hierarchy of internal dependencies or create my own from ground up or not use nuget package and have copy of lib code.
Other places also might benefit from extendibility, for example customization of rendering.
Possible solution is to avoid sealed internal classes and non-virtual methods without possibility to override their behaviour.
Alternatively leave classes sealed but all internals could be made public to create custom classes.
And the third, the safest, option is to add hooks to the main functionality of elements. Like it is done with SelectionPrompt.Converter.
Please upvote 👍 this issue if you are interested in it.