Could anyone explain to me why this does not render "VALUE IS DEFAULT"?
<TextBlock Text="{Binding Fail, StringFormat=VALUE IS {0}, FallbackValue=DEFAULT}" />
There is something tricky about this syntax I am missing. Thank you in advance.
Binding in WPF does not consider StringFormat while falling back to FallbackValue in case it fails.
You can use what leon suggested or go with PriorityBinding.
--EDIT--
This should work:
<TextBlock DataContext="{Binding Fail, FallbackValue=DEFAULT}" Text="{Binding StringFormat=VALUE IS {0}}" />
The default fallback value is used for priority bindings, if you'd like to display "VALUE IS DEFAULT" for a fallback value, try the following.
<TextBlock Text="{Binding Fail, StringFormat=VALUE IS {0}, FallbackValue='VALUE IS DEFAULT'}" />