[NET11.0][Editor] Implemented Completed command#32167
Open
NirmalKumarYuvaraj wants to merge 3 commits intodotnet:net11.0from
Open
[NET11.0][Editor] Implemented Completed command#32167NirmalKumarYuvaraj wants to merge 3 commits intodotnet:net11.0from
NirmalKumarYuvaraj wants to merge 3 commits intodotnet:net11.0from
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
This pull request adds new command support to the
Editorcontrol, allowing developers to bind anICommandthat will be executed when the editor's text is completed (e.g., when the user presses the return key). It introduces new bindable properties for the command and its parameter, updates the completion logic to execute the command, and adds unit tests to ensure the new functionality works as expected.New Editor Command Support:
Editor:ReturnCommand(of typeICommand) andReturnCommandParameter(of typeobject). These allow developers to bind a command and an optional parameter that will be executed when the editor completes input. [1] [2]SendCompletedmethod inEditorto execute the boundReturnCommand(with its parameter) if it is set, the editor is enabled, and the command can execute. The originalCompletedevent still fires as before.Public API and Platform Support:
Unit Testing:
CanExecutereturns false, and ensuring both theCompletedevent and the command fire when appropriate. [1] [2]Reference: https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Entry/Entry.cs
Issues Fixed
Fixes #7775