3

I have a MultiBinding, with 1 of the bindings, I want to use a static value eg. 1 or 0.33 how can I do that? also when I am at it, I want to bind to the value 1/3 = 0.33333... can I have an expression?

<!-- not correct syntax, but something like this is what I want to acheive -->
<Binding Value="1" />

UPDATE

I tried something like

<Binding Path="NonExistantValue" FallbackValue="0" />

But it fails ... in a "clean" app it works tho ...

Jiew Meng
  • 84,767
  • 185
  • 495
  • 805

1 Answers1

0

Ah, I found the answer

<!-- in resources -->
<sys:Single x:Key="Single0">0</sys:Single>

<!-- in multibinding -->
<Binding Source="{StaticResource Single0}" />

I am abit confused as to why Single is a float, why the difference in names?

Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
  • `Single` describes the type of `float`; it's single-precision float point number occupying 32 bits, as opposed to a `double`, which occupies 64 bits. – Rob May 02 '12 at 17:51