1

I'm using a string as a MultiBinding.ConverterParameter in a XAML-definition of a WPF-Window. The converter concatenates multiple strings and uses the ConverterParameter as separator between them. My problem is: when I want to use a CRLF as separator, the XAML-parser somehow escapes my backslashes. So i get "\\r\\n" as parameter in the converter. I tried the following variants:

<MultiBinding Converter="{StaticResource mergeStringsMultiValueConverter}" >
    <MultiBinding.ConverterParameter>
        \r\n
    </MultiBinding.ConverterParameter>
    <Binding Path="ApprovalJoystick.ExtendedDisplayString" Mode="OneWay"/>
    <Binding Path="ApprovalJoystickActiveText" Mode="OneWay" />
</MultiBinding>

and

<MultiBinding Converter="{StaticResource mergeStringsMultiValueConverter}" ConverterParameter="\r\n">
    <Binding Path="ApprovalJoystick.ExtendedDisplayString" Mode="OneWay" />
    <Binding Path="ApprovalJoystickActiveText" Mode="OneWay" />
</MultiBinding>

Result is the same. Is the a way to get the CRLF as I wrote it in XAML (without escaping)? Or can I write the linebreak in another way in XAML?

Thank you.

woelfchen42
  • 419
  • 2
  • 8

1 Answers1

0

Try &#10;, &#13; or &#x0d;&#x0a;. See Newline in string attribute.

Étienne Laneville
  • 4,697
  • 5
  • 13
  • 29