XAML: How do I append a percent symbol to a bound label value?
bind, format, label, xaml
Solution
This works fine for me (tested in Kaxaml):
<StackPanel>
<Slider Minimum="0" Maximum="100" x:Name="slider" />
<TextBlock Text="{Binding Path=Value, ElementName=slider, StringFormat='\{0\}%'}" />
</StackPanel>
Without the backslashes I got an error saying that the % character was invalid in that position.
Problem
I have a label bound to the value of a slider. ``` Content="{Binding Path=Value, ElementName=Slider}" ``` How do I append a percentage symbol? The value of the slider is already formatted correctly, so when the value is '50', all I need is '50%'. I know how to do it in code behind but I was hoping to accomplish this in xaml without creating a converter. TIA