I am using the .Net Maui’s community toolkit and have some mvvm binding going on in a project.
I have a collectionview and a Searchbar connected to a ViewModel. I wish to implement the Searchbar’s is TextChanged, but with no luck.
it is saying,
Event "Textchanged" can only be bound to properties of delegate type ‘EventHandler’1’
I saw this Solution here on stack overflow, I however am using the COmmunityToolkit.
Below are the XAML and ViewModel
>Solution :
You can use EventToCommandBehavior of CommunityToolkit to bind Command:
<SearchBar ....>
<SearchBar.Behaviors>
<toolkit:EventToCommandBehavior
EventName="TextChanged"
Command="{Binding TextChangedCommand}" />
</SearchBar.Behaviors>
</SearchBar>

