Changes

EvalExpression

246 bytes added, 07:50, 11 January 2021
/* Setting a calculated Property Value */
<tab name="Xamarin">
The following example shows how to create a button that adds and stores +5 to the value of a a numeric property named ''MP_EXAMPLE'', every time it is pressed:
<source lang = "xml">
<Grid xmlns:ctrls="using:UBIK.WinX.Controls">
<ctrls:EvalExpression x:Name="Evaluator" Expression="&quot;MP_EXAMPLE|&quot; + (P0 + 2)">
<ctrls:EvalExpressionParameter Name="P0" Value="{Binding Values[MP_EXAMPLE], Converter={StaticResource ToType}, ConverterParameter='System.Int32'}" />
<Button Text="Tap to add 2 more"
Command="{Binding SetPropertyValueAndValidateCommand}" CommandParameter="{Binding ElementName=Evaluator, Path=Result}"/>
</Grid>
</source>
</tab>
</tabs>