0

I have a TextBlock element and a Quantity (int) property.
I want to convert the value to a string.
The conversion must be like this:

Quantity == 0 ? "" : Quantity

I'm trying to use the CalcBinding extension, but I wasn't able to write the expression with the correct syntax.

<TextBlock TextWrapping="Wrap" Text="{c:Binding '(Quantity == 0 ? "" : Quantity)'}"
           Margin="-32,0,0,0" Height="16"
           HorizontalAlignment="Center" />

The above doesn't work.
I think that the quotes are my problem, but I don't know how to fix it.

ASh
  • 34,632
  • 9
  • 60
  • 82
Relok
  • 301
  • 4
  • 14

1 Answers1

0

For those who still wants to know the solution, here it is:

Binding="{c:Binding (IsActive ? \'Yea\' : \'No\')}"/>
Ivan Kara
  • 129
  • 4
  • 12