Skip to content

[NET11.0][Editor] Implemented Completed command#32167

Open
NirmalKumarYuvaraj wants to merge 3 commits intodotnet:net11.0from
NirmalKumarYuvaraj:fix-7775
Open

[NET11.0][Editor] Implemented Completed command#32167
NirmalKumarYuvaraj wants to merge 3 commits intodotnet:net11.0from
NirmalKumarYuvaraj:fix-7775

Conversation

@NirmalKumarYuvaraj
Copy link
Copy Markdown
Contributor

@NirmalKumarYuvaraj NirmalKumarYuvaraj commented Oct 23, 2025

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 Editor control, allowing developers to bind an ICommand that 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:

  • Added two new bindable properties to Editor: ReturnCommand (of type ICommand) and ReturnCommandParameter (of type object). These allow developers to bind a command and an optional parameter that will be executed when the editor completes input. [1] [2]
  • Updated the SendCompleted method in Editor to execute the bound ReturnCommand (with its parameter) if it is set, the editor is enabled, and the command can execute. The original Completed event still fires as before.

Public API and Platform Support:

  • Registered the new properties and accessors in the public API files for all supported platforms, ensuring the new command functionality is available and discoverable in the public API surface. [1] [2] [3] [4] [5] [6] [7]

Unit Testing:

  • Added comprehensive unit tests for the new command functionality, including tests for command execution, command not executing when the editor is disabled, command not executing when CanExecute returns false, and ensuring both the Completed event 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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-editor Editor community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Editor] Completed command

7 participants