Changes

HowTo:Implement Custom Filtering

1,603 bytes added, 30 July
/* Filtering a DateTime Property */ added section on DateTime members
{{Hint|Note the .CompareTo method used in each half of the ranged filter expression; the start date comparison is <noWiki>!=-1</noWiki>, whereas the end date comparison <noWiki>!=1</noWiki>.}}
</tabs>
 
<br>
<br>
{{UnderConstructionEnd}}
 
==== Individual DateTime Components ====
The DateTime property has the additional benefit of exposing components that can be used to refine filtering.
[[Developer_Mode]] reveals the members available under the binding path; <source lang = "xml">PropertyItems["DATETIME"].Value</source>. These include; Date, Day, DayOfWeek, DayOfYear, Hour, Millisecond, Minute, Month, Ticks, TimeOfDay, and Year.
These can be used in the EvalExpressionParameter as a binding in the custom expression string, as follows, and can even be used in separate filters to search individual components of the date seperately (for example, to filter by a particular month, year, or even day of the week).
<tabs>
<tab name="UWP">
<source lang = "xml">
<controls:EvalExpressionParameter Name="EXP" Value="{Binding ElementName=DateInput, Path=Tag, Converter={StaticResource StringFormatConverter}, ConverterParameter='Item.PropertyItems[&quot;DATE&quot;].Value.DayOfWeek.ToString().Contains(&quot;{0}&quot;.ToLower())==true'}" />
</tab>
<tab name="Xamarin">
<source lang = "xml">
<controls:EvalExpressionParameter Name="EXP" Value="{Binding Source={x:Reference DayWeekInputString}, Path=Text, Converter={StaticResource StringFormat}, ConverterParameter='Item.PropertyItems[&quot;DATE&quot;].Value.DayOfWeek.ToString().ToLower().Contains(&quot;{0}&quot;.ToLower())==true'}" />
</source>
</tab>
</tabs>
<br>
<br>
{{UnderConstructionEnd}}
[[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]]
== Adjustments ==
696
edits