<TextBox x:Name="Param0" Width="200" />
<TextBox x:Name="Param1" Width="200" />
<ctrls:EvalExpression x:Name="Evaluator" Expression="{Binding ElementName=Expression, Path=Text}" Context="{Binding}">
<ctrls:EvalExpressionParameter Name="P0" Value="{Binding ElementName=Param0, Path=Text, Converter={StaticResource ToType}, ConverterParameter='System.Int32'}" />
<ctrls:EvalExpressionParameter Name="P1" Value="{Binding ElementName=Param1, Path=Text, Converter={StaticResource ToType}, ConverterParameter='System.Int32'}" />
<StackLayout xmlns:ctrls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL">
<Editor x:Name="Expression"/>
<Editor x:Name="Param0P0" WidthWidthRequest="32"/> <Editor x:Name="Param1P1" WidthWidthRequest="43"/> <ctrls:EvalExpression x:Name="Evaluator" Expression="{Binding Path=Text, Source={x:Reference Expression}}" Context="{Binding}"> <ctrls:EvalExpressionParameter Name="P0" Value="{Binding Path=WidthWidthRequest, Source={x:Reference Param0P0}}" /> <ctrls:EvalExpressionParameter Name="P1" Value="{Binding Path=WidthWidthRequest, Source={x:Reference Param1P1}}" />
</ctrls:EvalExpression>
<Label Text="{Binding Path=Result, Source={x:Reference Evaluator}}" />
</StackLayout>
</source>
Lets assume that the Textbox ''Param0''has a width of 32 and ''Param1'' has a width of 43. If ''Expression'' now contains <code>(P0 + P1) *2</code> then the result would display 75.</tab>
</tabs>
[[Category:Client|EvalExpression]][[Category:Pages with broken file links|EvalExpression]][[Category:WinX|EvalExpression]][[Category:Xamarin|EvalExpression]]
==== Setting a calculated Property Value ====
<source lang = "xml">
<Grid xmlns:ctrls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL">
<ctrls:EvalExpression x:Name="Evaluator2" Expression=""MP_EXAMPLE|" + (P0 + 2)" Context="{Binding}">
<ctrls:EvalExpressionParameter Name="P0" Value="{Binding Values[MP_EXAMPLE]}" />
</ctrls:EvalExpression>