I have some text which has "\r\n" newline markers. I would like to have the newlines in a WPF textblock. I've tried replacing "\r\n" with "& # 13;" (without the spaces), which worked when I set the Text property in XAML, but doesn't seem to work when setting from the C# code-behind.
So...what's the standard way to convert "\r\n" to newlines in a WPF textblock?
When writing C# I always use "System.Environment.Newline" for the newline carriage return.
It means that you don't have to worry about character coding or what destination OS uses.
I have also found it to work on WPF GUI when called from the underlying .cs file.
Try these for a more WPF centric solution.
See also : XAML based Answer