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

Hook up TokenizingTextBox AutoSuggestBoxStyle #657

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

miksalmon
Copy link

Fixes #656

The AutoSuggestBoxStyle dependency property is not hooked up to the AutoSuggestBox's style in TokenizingTextBoxItemTextStyle. Is uses the static resource SystemAutoSuggestBoxStyle.

This fix sets the AutoSuggestBox's style in TokenizingTextBoxItemTextStyle to the AutoSuggestBoxStyle of the TokenizingTextBox and sets the AutoSuggestBoxStyle's default value to that of SystemAutoSuggestBoxStyle.

PR Type

What kind of change does this PR introduce?

Bugfix

What is the current behavior?

TokenizingTextBox's AutoSuggestBoxStyle is not applied

What is the new behavior?

TokenizingTextBox's AutoSuggestBoxStyle is applied

PR Checklist

  • [X ] Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • [X ] Based off latest main branch of toolkit
  • [ X] Tested code with current supported SDKs
  • [ X] Contains NO breaking changes

@miksalmon miksalmon changed the title use TokenizingTextBox AutoSuggestBoxStyle in TokenizingTextBoxItemTex… Hook up TokenizingTextBox AutoSuggestBoxStyle Mar 13, 2025
@miksalmon
Copy link
Author

@dotnet-policy-service agree company="Microsoft"

@michael-hawker michael-hawker added this to the 8.2 milestone Mar 13, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main comment is that the SystemAutoSuggestBoxStyle is defined here in this file compared to where it's now getting referenced in TokenizingTextBox.xaml. So, it'd probably have to move to be properly looked up?

However, I'm not even sure if this is needed anymore and if it's a remnant of system WUX xaml when we weren't building on top of WinUI 2, like we are now for UWP and WinUI 3 for WASDK. Like we may just be able to reference DefaultAutoSuggestBoxStyle now?

@miksalmon did you notice a difference before/after here?

FYI @niels9001 who may be able to comment here. Doing a diff between what we have and the system style it doesn't appear there's a ton of big differences. Mostly the alignment top vs. stretch.

Copy link
Author

@miksalmon miksalmon Mar 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-hawker During testing, I confirmed it works by keeping it there. I tested by modifying SystemAutoSuggestBoxStyle and making sure this was getting applied properly, which it did.

It can probably look it up just fine because TokenizingTextBoxItem.AutoSuggestBox.xaml is imported in TokenizingTextBox.xaml where it's used.

I'll be honest, I didn't verify what the actual differences were. It's possible we could use the default style or the default SystemAutoSuggestBoxStyle instead and get rid of this redefined one.

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

Successfully merging this pull request may close these issues.

TokenizingTextBox AutoSuggestBoxStyle does not work
2 participants