I want to add percent sign "%" to any input text in wpf TextBox when the user insert a text.
So when the user will enter a number, will be added % sign to any number in the input box, for example: 5 will shown at the Text box as 5% 0 - 0% 100 - 100%
I tried the following code:
<TextBox x:Name="TextBoxInputValue" Text="{Binding AddPercentSign, UpdateSourceTrigger=PropertyChanged, StringFormat={}{0}%}" Style="{StaticResource @TextBoxStyle}" Width="100" Height="20"></TextBox>
and:
public int AddPercentSign{ get; set; }
and:
TextBoxInputValue.DataContext = this;
But it has no effect on the TextBox when the user insert an input...
How can I achieve that result?
Thank you