Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concatenate string via XAML

I have this label inside ProgressBar that take it's value form the Progressbar value and i want to add the char % after the ProgressBar value.

I have tried two options that not working:

<Label Content="{Binding Progress}" ContentStringFormat="{}{0} %" />
<Label Content="{Binding Progress, StringFormat={}{0}%}" />
like image 976
Verint Verint Avatar asked Mar 16 '23 21:03

Verint Verint


1 Answers

e.g. with ContentStringFormat:

<Label Content="{Binding Progress}" ContentStringFormat="{}{0} %" />

or you use Standard Numeric Format Specifier P

ContentStringFormat="{}{0:P}"

This all is very similar to String.Format.

like image 178
LPL Avatar answered Mar 29 '23 01:03

LPL