Changes
/* Comparison */ Restructed Open and Closed range sections into one
'''Open Range'''
<br>
For range comparison, we use the [https://learn.microsoft.com/en-us/dotnet/api/system.string.compareto?view=net-9.0 Microsoft .CompareTo method]. As documented there, this method outputs a -1/0/1 depending on the compared string's location in the range. Our expression can target one output for an 'exclusive' filter (in which the inputted date is not considered for the range), however, a more likely scenario is that the user wants the inputted date included in the filter. This is why the expression in the StringFormatConverter should be defined for start date as either !=-1 or , and for end date as !=1; the instance is either should be not less than a minimum than the start date (where true would be an output of 0 or 1), or and not greater than a maximum the end date (true = -1 or 0), respectively.
<tabs>
<tab name="UWP - Starting From">
<source lang = "xml">
<controls:EvalExpression x:Name="FilterExpressionStart_FilterExpression" Context="{Binding}" Expression="(INPUT==null||INPUT=="") ? "true==true" : EXP"> <controls:EvalExpressionParameter Name="EXP" Value="{Binding PathElementName=TagStartInput, ElementNamePath=DateInputTag, Converter={StaticResource StringFormatConverter}, ConverterParameter='Item.PropertyItems["DATE"].Value.ToString("yyyy/MM/dd").CompareTo("{0}")!="-1"'}" /> <controls:EvalExpressionParameter Name="INPUT" Value="{Binding PathElementName=TagStartInput, ElementNamePath=DateInputText}" />
</controls:EvalExpression>
<controls:EvalExpression x:Name="End_FilterExpression" Context="{Binding}" Expression="(INPUT==null||INPUT=="") ? "true==true" : EXP">
<controls:EvalExpressionParameter Name="EXP" Value="{Binding ElementName=EndInput, Path=Tag, Converter={StaticResource StringFormatConverter}, ConverterParameter='Item.PropertyItems["DATE"].Value.ToString("yyyy/MM/dd").CompareTo("{0}")!="1"'}" />
<controls:EvalExpressionParameter Name="INPUT" Value="{Binding ElementName=EndInput, Path=Text}" />
</controls:EvalExpression>
<controls:EvalExpression x:Name="FilterExpression" Context="{Binding}" Expression="START +"&&"+ END">
<controls:EvalExpressionParameter Name="START" Value="{Binding ElementName=Start_FilterExpression, Path=Result}" />
<controls:EvalExpressionParameter Name="END" Value="{Binding ElementName=End_FilterExpression, Path=Result}" />
</controls:EvalExpression>
</source>
</tab>
<tab name="Xamarin - Starting From">
<source lang = "xml">
<controls:EvalExpression x:Key="FilterExpressionStart_FilterExpression" Expression="(INPUT==null||INPUT=="") ? "true==true" : EXP " Context="{Binding}"> <controls:EvalExpressionParameter Name="EXP" Value="{Binding Source={x:Reference DateStringStartString}, Path=Text, Converter={StaticResource StringFormat}, ConverterParameter='Item.PropertyItems["DATE"].Value.ToString("yyyy/MM/dd").CompareTo("{0}")!="-1"'}" /> <controls:EvalExpressionParameter Name="INPUT" Value="{Binding Source={x:Reference DateStringStartString}, Path=Text}" /></controls:EvalExpression><controls:EvalExpression x:Key="End_FilterExpression" Expression="(INPUT==null||INPUT=="") ? "true==true" : EXP " Context="{Binding}"> <controls:EvalExpressionParameter Name="EXP" Value="{Binding Source={x:Reference EndString}, Path=Text, Converter={StaticResource StringFormat}, ConverterParameter='Item.PropertyItems["DATE"].Value.ToString("yyyy/MM/dd").CompareTo("{0}")!="1"'}" /> <controls:EvalExpressionParameter Name="INPUT" Value="{Binding Source={x:Reference EndString}, Path=Text}" />
</controls:EvalExpression>
</controls:EvalExpression>
</source>
</tab>
{{Hint|The difference between seeking a 'Staring From' (0, 1) or 'Ending By' comparison (-1, 0) is simply defined Note the .CompareTo method used in each half of the EXP ConverterParameter ranged filter expression string, which ends with ; the start date comparison is <noWiki>!=-1</noWiki>, or whereas the end date comparison <noWiki>!=1</noWiki>, respectively.}}
</tabs>
<br>