My textbox provides the filtered string to the collection and when I enter new value in the textbox, I want my collection to be refreshed as per the new filter value. I want to put the filtering logic not in my viewmodel or code behind but only in XAML. The code is attached below. The sorting and grouping are working fine. I have checked this answer: https://stackoverflow.com/a/6462282/5130106, it is almost doing the stuff but lacks when it comes to refreshing the collection, therefore, I am creating a new question, as I cannot find an answer.
Is there a way I could achieve this?
<TreeView x:Name="SystemsTreeView" ItemsSource="{Binding Source={StaticResource SystemCollection}, Path=Groups}">
<CollectionViewSource x:Key="SystemCollection" Source="{Binding SystemsList}" Filter="{MyLogic}">
<!--Sorting of Systems-->
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="SystemName"/>
<scm:SortDescription PropertyName="Version" Direction="Descending"/>
</CollectionViewSource.SortDescriptions>
<!--Grouping of Systems-->
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="SystemName" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>