0

I meet a very strange thing when I try to display string which include char '' using WPF data binding. Here is my description. I put 8 .txt files in a folder like follow picture.These files' name are different by using ''. I make them different file size. enter image description here

In my Application, I get file name by using code :

//Get all FileInfo object
DirectoryInfo directoryInfo = new DirectoryInfo(LocalDir);
FileInfo[] files = directoryInfo.GetFiles(LocalFileMask);
...
foreach (var i in files)
...
FileName = i.Name,
...

But my UI Cannot display filename correct, like in picture 2 : enter image description here

Your can see the diffrent between folder and UI view. And I am very sure that they are right in code(see statusBar) , just something wrong with Label or TreeviewItem Content(Data Binding with string:FileName) Display. Maybe change a property of UI element will fix this issue. Can anyone give me some advise?

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
Bob
  • 107
  • 6
  • Seems like StackOverFlow either correctly display _ ? – Bob Mar 11 '16 at 06:57
  • String which StartWith(underline char) or EndWith(underline char) has this issue. – Bob Mar 11 '16 at 07:04
  • Use TextBlock not Lable . Find it. http://stackoverflow.com/questions/40733/disable-wpf-label-accelerator-key-text-underscore-is-missing – Bob Mar 11 '16 at 07:07

0 Answers0