Jump to: navigation, search

Changes


EvalExpression

173 bytes removed, 11:56, 29 April 2021
<Label
TextColor="#00000"
IsVisible="{Binding Path=Result, Source={x:Reference Evaluator}, Converter={StaticResource NullToBoolConverterBoolToBool}}" />
</StackLayout>
</source>
If / Or statements can also be evaluated using C# syntax.
In this case, if the result of the "Condi" parameter is true, namely if the context object's MP_STATUS property value equals to 100, P0's value will be displayed in the Label, otherwise P1's value will be displayed.
<tabs>
<Grid xmlns:ctrls="using:UBIK.WinX.Controls">
<ctrls:EvalExpression x:Name="Evaluator" Expression="Condi == true ? P0 : P1" Context="{Binding}">
<ctrls:EvalExpressionParameter Name="Condi" Value="{Binding Values[MP_STATUS], Converter={StaticResource EqualToTrueConverter}, ConverterParameter=100}" />
<ctrls:EvalExpressionParameter Name="P0" Value="State1" />
<ctrls:EvalExpressionParameter Name="P1" Value="State2" />
</tab>
</tabs>
 
[[Category:Client|EvalExpression]]
[[Category:Pages with broken file links|EvalExpression]]
[[Category:WinX|EvalExpression]]
[[Category:Xamarin|EvalExpression]]
==See also==