-
-
Notifications
You must be signed in to change notification settings - Fork 779
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
AutoSuggestBox text property twoway binding error #731
Comments
This happens because TextPropertyChangedCallback is static and called before From documentation on Text property:
So probably a Now for your problem, what are you trying to achieve? If you want to give AutoSuggestBox a default value, that is probably not a good idea and won't work. Changes in AutoSuggestBox source code are required for that. If you want to update your If you want to set Property in your ViewModel after some option is chosen, that is only possible in code-behind in <ui:AutoSuggestBox
x:Name="AutoSuggestBox"
SuggestionChosen="AutoSuggestBox_OnSuggestionChosen" ... />
private void AutoSuggestBox_OnSuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
{
ViewModel.ChosenOptionProperty = args.SelectedItem as MyOptionsItemType;
} |
Ohhhh, ok, thank you for your very useful response friend. Sorry I missed that! Lol. |
Describe the bug
Typing into the AutoSuggestBox text with a binding gives me this error
To Reproduce
Typing into the AutoSuggestBox text with a twoway binding
Expected behavior
No error
Screenshots
OS version
Windows 11
.NET version
.NET 7.0
WPF-UI NuGet version
3.0.0-preview.5
Additional context
No response
The text was updated successfully, but these errors were encountered: