My sample code is below.
I want to pass 'Go to linked item' to ConverterParameter
but I can't because the string has spaces.
Text="{Binding Value,
Source={x:Static local:Dictionary.Instance},
Converter={StaticResource StringConverter},
ConverterParameter=Go to linked item, Mode=OneWay}"
How can I do this?
Option 1
Text="{Binding Value,
Source={x:Static local:Dictionary.Instance},
Converter={StaticResource StringConverter},
ConverterParameter='Go to linked item', Mode=OneWay}"
Option 2
If you want to use this in multiple places add a string resource.
<sys:String x:Key="GoToLink">Go to linked item</sys:String>
And pass the resource key.
ConverterParameter={StaticResource ResourceKey=GoToLink}}
If your string has spaces then wrap it in single quotes, double quotes won't work; this is probably due to the fact that the entire text field is wrapped in double quotes and so using them again within the binding would incorrectly indicate closure.
Text="{Binding Value,
Source={x:Static local:Dictionary.Instance},
Converter={StaticResource StringConverter},
ConverterParameter='Go to linked item', Mode=OneWay}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With