Skip to content

Conversation

@corvinsz
Copy link
Member

@corvinsz corvinsz commented Oct 7, 2025

fixes #3939

This PR changes 2 things about the AutoSuggestBox:

  1. Horizontal- and VerticalContentAlignment of ListBoxItems in AutoSuggestBox (see the linked issue above). I would say we just stretch the content instead of adding new properties to the AutoSuggestBox. This way consumers can align the content themselfs by setting the Horizontal- and VerticalContentAlignment in the ItemTemplate.
  2. allows for "interactable" content in the suggestion ListBox.

Additionally I refactored the demo to use the CommunityToolkit.MVVM toolkit and added an additional AutoSuggestBox example.

Before

autoSuggestBoxPre.mp4

After

autoSuggestBoxPost.mp4

Refactored `FieldsViewModel` to use `CommunityToolkit.Mvvm` attributes, reducing boilerplate code and improving maintainability.

Added `AutoSuggestBox3` with dynamic filtering, interactive item templates, and a command to remove suggestions. Enhanced `AutoSuggestBox` behavior to support interactive elements like buttons without closing the popup.

Updated `Fields.xaml` to include new `AutoSuggestBox` variations and bindings. Introduced a new `AutoSuggestTextBoxWithInteractiveTemplate` sample to demonstrate interactive item templates.

Added tests to validate interactive `AutoSuggestBox` behavior. Performed general cleanup and modernization, including concise syntax and collection initializers.
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

Successfully merging this pull request may close these issues.

HorizontalContentAlignment of ListBox in AutoSuggestBox

1 participant