I have this:
<Label Text="{Binding Height}" AbsoluteLayout.LayoutBounds=".9,.17,-1,-1" TextColor="White" AbsoluteLayout.LayoutFlags="PositionProportional" HorizontalTextAlignment="Center" HorizontalOptions="Center" FontSize="Medium"/>
Obviously {Binding Height} takes up the entire text.
The binding is currently a double, and needs to remain so, I just need to concat an 'm' at the end to represent meters.
I have tried {Binding Height} m and {Binding Height + m} but obviously xaml doesn't work the same way a regular string concatenation would work.
Try using
StringFormat
. Like this:Edited for clarity:
You can write anything you want after the
{0}
argument.For example, the above will produce values like 25m, 10m etc.
You can write something like this if you like:
The above will produce, for example: