Is it possible to have some static text and a bindable context in the same label?
<Label Text = "${Binding totalCost}"
x:Name = "totalCost"
HorizontalOptions = "Start"
VerticalOptions = "Start"
Grid.Row = "6" Grid.Column = "1"/>
Except this displays as "${Binding totalCost}"
I know I could just easily set the field by doing something like totalCost.Text = String.Format("${0}", totalCost);
but just wanted to see if it was possible the other way
See if this works for you:
Text="{Binding totalCost, StringFormat=${0}}"
For labels there is additional feature: ContentStringFormat, example bellow:
<Label Content="{Binding Tag, FallbackValue=Custom}" ContentStringFormat="Length: {0}" DataContext="{Binding ElementName=cbRebarLength, Path=SelectedItem}"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With