The issue was that I was binding to a property of type object. by changing this to a string property the stringformat was used as expected.
Is it possible to use both a converter AND a StringFormat in WPF MultiBinding?
-
02-06-2022 - |
Question
I am using the following MultiBinding. The converter outputs an int and the expected output of the MultiBinding is something like "SomeText|123". The Bindings and converter work fine, but the StringFormat doesn't seem to be applied - I just get the int value that the converter outputs. Is it possible to apply the StringFormat to the IMultiValueConverter's output?
<MultiBinding Converter="{StaticResource MyConverter}"
StringFormat="SomeText|{}{0}">
<Binding />
<Binding Path="SomePath" />
</MultiBinding>
Thanks!
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow