Skip to content

Extendibility of elements #1258

@dvdking

Description

@dvdking

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions