<br>
=== One Input To Filter Multiple Properties ===
Since we have control over how the input is matched against the properties, is possible to use the same input to filter against multiple properties, for example, both Title and SubTitle. This keeps the UI lean with less elements to clutter the layout, and the user is not forced to think about which input relates to which field. The downside, of course, is that the search will be slightly less refined.
This is achieved easily as shown:
<tabs>
<tab name="UWP">
<source lang = "xml">
<controls:EvalExpression x:Name="Title_FilterExpression" Expression="(INPUT==null||INPUT=="") ? "true==true" : EXP " Context="{Binding}">
<controls:EvalExpressionParameter Name="EXP" Value="{Binding ElementName=FilterInput, Path=Text, Converter={StaticResource StringFormatConverter}, ConverterParameter='Item.Title.ToLower().Contains("{0}".ToLower())==true'}" />
<controls:EvalExpressionParameter Name="INPUT" Value="{Binding ElementName=FilterInput, Path=Text}" />
</controls:EvalExpression>
<controls:EvalExpression x:Name="SubTitle_FilterExpression" Expression="(INPUT==null||INPUT=="") ? "true==true" : EXP " Context="{Binding}">
<controls:EvalExpressionParameter Name="EXP" Value="{Binding ElementName=FilterInput, Path=Text, Converter={StaticResource StringFormatConverter}, ConverterParameter='Item.SubTitle.ToLower().Contains("{0}".ToLower())==true'}" />
<controls:EvalExpressionParameter Name="INPUT" Value="{Binding ElementName=FilterInput, Path=Text}" />
</controls:EvalExpression>
<controls:EvalExpression x:Name="FilterExpression" Context="{Binding}" Expression="TIT +"||"+ SUB">
<controls:EvalExpressionParameter Name="TIT " Value="{Binding ElementName=Title_FilterExpression, Path=Result}" />
<controls:EvalExpressionParameter Name="SUB" Value="{Binding ElementName=SubTitle_FilterExpression, Path=Result}" />
</controls:EvalExpression>
</source>
</tab>
<tab name="Xamarin">
<source lang = "xml">
<controls:EvalExpression x:Key="Title_FilterExpression" Expression="(INPUT==null||INPUT=="") ? "true==true" : EXP " Context="{Binding}">
<controls:EvalExpressionParameter Name="EXP" Value="{Binding Source={x:Reference FilterInput}, Path=Text, Converter={StaticResource StringFormat}, ConverterParameter='Item.Title.ToLower().Contains("{0}".ToLower())==true'}" />
<controls:EvalExpressionParameter Name="INPUT" Value="{Binding Source={x:Reference FilterInput}, Path=Text}" />
</controls:EvalExpression>
<controls:EvalExpression x:Key="SubTitle_FilterExpression" Expression="(INPUT==null||INPUT=="") ? "true==true" : EXP " Context="{Binding}">
<controls:EvalExpressionParameter Name="EXP" Value="{Binding Source={x:Reference FilterInput}, Path=Text, Converter={StaticResource StringFormat}, ConverterParameter='Item.SubTitle.ToLower().Contains("{0}".ToLower())==true'}" />
<controls:EvalExpressionParameter Name="INPUT" Value="{Binding Source={x:Reference FilterInput}, Path=Text}" />
</controls:EvalExpression>
<controls:EvalExpression x:Key="FilterExpression" Context="{Binding}" Expression="TIT +"||"+ SUB">
<controls:EvalExpressionParameter Name="TIT" Value="{Binding Source={StaticResource Title_FilterExpression}, Path=Result}" />
<controls:EvalExpressionParameter Name="SUB" Value="{Binding Source={StaticResource SubTitle_FilterExpression}, Path=Result}" />
</controls:EvalExpression>
</source>
</tab>
</tabs>
{{Attention|Note the different operator required in this case. Unless your object has the same Title ''and'' SubTitle, there will be no match found unless the FilterExpression is amended to an Or relationship.}}
<br>
[[Category:Client|Custom Filtering]]
[[Category:Filtering|Custom Filtering]]
[[Category:Styling|Custom Filtering]]
[[Category:WinX|Custom Filtering]]
[[Category:XAML|Implement Custom Filtering]]
[[Category:Xamarin|Custom Filtering]]
== Combining Dynamic (User Inputs) and Static (Predefined) Criteria ==