<!-- Create a TextBlock where we display the result of the compiled expression -->
<TextBlock Text="{Binding ElementName=CodeQuery, Path=Text, Converter={StaticResource CodeConverter}}" />
</StackPanel>
</Grid>
</source>
* [[CollectionToViewConverter]]
Converts a collection into a view that can be filtered using C# expressions and returns the (filtered) result.
Example:
<source lang = "xml">
<Grid>
<Grid.Resources>
<!-- Instantiate the converter and bind the Source to the collection we want to use on a UI element of this page -->
<converters:CollectionToViewConverter x:Key="ColConv" Source="{Binding Children.Items}" />
</Grid.Resources>
<StackPanel Orientation="Horizontal">
<!-- Create a TextBox where we can enter a C# expression -->
<TextBox
x:Name="FilterQuery"
Height="40" MinWidth="240"
Margin="0,10,10,0" HorizontalAlignment="Right"
VerticalAlignment="Top"
FontSize="18"
PlaceholderText="Filter" />
<!-- Create a ListView and bind its ItemsSource to the expression pulled through the converter -->
<ListView
x:Name="ChildListView"
HorizontalContentAlignment="Stretch"
ItemsSource="{Binding ElementName=FilterQuery, Path=Text, Converter={StaticResource ColConv}}"
</ListView>
</StackPanel>
</Grid>