Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EditableTextBlock Control #131

Open
yangf85 opened this issue Feb 28, 2024 · 0 comments
Open

Add EditableTextBlock Control #131

yangf85 opened this issue Feb 28, 2024 · 0 comments

Comments

@yangf85
Copy link

yangf85 commented Feb 28, 2024

Title: Feature Request:

Body:

Description
As a user of the [YourLibraryName] library, I find myself needing a way to display text that can be easily switched to an editable state. This would allow users to view text and edit it in place without the need for a separate edit mode or a different control. I propose the addition of an EditableTextBlock control to address this need.

Use Case
The EditableTextBlock would be particularly useful in scenarios where inline editing of labels, data fields, or settings is required. This could be in a settings pane, data grid, or any form that benefits from a non-disruptive editing experience.

Proposed Behavior
The control should display text like a normal TextBlock by default.
When the user double-clicks on the text or presses an “Edit” button, the control switches to an editable state.
In the editable state, the text should be presented in a TextBox to allow for user input.
Pressing “Enter” or moving the focus away from the TextBox should save the changes and revert the control back to the non-editable state.
Pressing “Escape” should cancel the edit and revert the changes.
Possible Properties
Text: The text displayed and edited by the control.
IsEditable: A boolean indicating whether the text can be edited.
EditMode: An enum to control the edit trigger (e.g., DoubleClick, SingleClick, Manual).
TextWrapping: To control text wrapping within the control.
AcceptsReturn: Whether the TextBox accepts return for creating new lines.
Visual Mockup
(Optional: Include any mockups or diagrams that might help visualize the control.)

Additional Context
This control would enhance the usability of forms and data display by reducing the need for separate edit modes or dialogs. It would also align with the behavior seen in many modern applications, providing a familiar experience for users.

I’m looking forward to hearing your thoughts on this feature request and discussing its potential implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant