Skip to content

Implement TextSearch.TextBinding #18405

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

Merged
merged 3 commits into from
Apr 2, 2025

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Mar 9, 2025

What does the pull request do?

This PR implements TextSearch.TextBinding.
This is the equivalent of WPF's TextSearch.TextPath.

This new property is used in SelectedItemsControl to search for items.
Additionally, ItemsControl.DisplayMemberBinding is used as a fallback, matching WPF.

For each item, the first non-empty text from the following list will be considered:

  • TextSearch.Text (if the item is a control)
  • TextSearch.TextBindingProperty - New
  • ItemsControl.DisplayMemberBinding - New
  • Content.ToString (if the item is a IContentControl)
  • ToString

Unit tests have been added.

Notes

@MrJul MrJul added feature api-approved The new public APIs have been approved. labels Mar 9, 2025
@MrJul MrJul mentioned this pull request Mar 9, 2025
3 tasks
@MrJul
Copy link
Member Author

MrJul commented Mar 22, 2025

Note: needs #18425 first.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0055874-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added this pull request to the merge queue Apr 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 2, 2025
@maxkatz6 maxkatz6 merged commit b09e0d5 into AvaloniaUI:master Apr 2, 2025
10 checks passed
almightyju added a commit to almightyju/Avalonia that referenced this pull request Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-approved The new public APIs have been approved. feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants