Closed scriptBoris closed 4 years ago
Could you please be more specific?
I want use binding Commands
More specific as in multiple descriptive sentences, and example code that demonstrates what doesn't work and what you want to achieve.
Close due to lack of feedback. Feel free to provide more detailed information and reopen.
Hi @dotMorten ,
First, thank you for this very nice auto complete component !
To explain a bit more the origin of this topic, I would say it was about "How to trigger a Command (located in the binded ViewModel) from your component in the XAML View ?".
Well actually, I wondered it too, and I've followed the recommendation of @ta-yamaoka .
Hence, if you still want to do that @scriptBoris , please check the snippet below :
`
<autoComplete:AutoSuggestBox
ItemsSource="{Binding SuggestedItems}"
PlaceholderText="Write some text"
Text="{Binding SelectedItem, Mode=TwoWay}">
<autoComplete:AutoSuggestBox.Behaviors>
<behaviors:EventToCommandBehavior
Command="{Binding AutoCompleteTextChanged}"
CommandParameter="AutoSuggestBoxTextChangedEventArgs"
EventName="TextChanged" />
<!--<behaviors:EventToCommandBehavior
Command="AutoCompleteSuggestionChosen"
CommandParameter="AutoSuggestBoxSuggestionChosenEventArgs"
EventName="SuggestionChosen" />-->
<behaviors:EventToCommandBehavior
Command="{Binding AutoCompleteQuerySubmitted}"
CommandParameter="AutoSuggestBoxQuerySubmittedEventArgs"
EventName="QuerySubmitted" />
</autoComplete:AutoSuggestBox.Behaviors>
</autoComplete:AutoSuggestBox>`
How it worked with MVVM?