A very simple question:
Why I cant see _ (underscore) in WPF content?
For instance the content of
I was binding to a data source which I didn't want to change, so I used a custom converter to create the missing underscore:
[ValueConversion(typeof(string), typeof(string))]
public class ShowUnderscoreConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
value is string text ? text.Replace("_", "__") : null;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
value is string text ? text.Replace("__", "_") : null;
}