User can't type '.' in the textbox that have been bound to a float value while UpdateSourceTrigger is PropertyChanged in WPF
Maybe it would help if you add a StringFormat statement in your binding:
<TextBox
Text="{Binding Amount, StringFormat='{}{##.##}', UpdateSourceTrigger=PropertyChanged}"/>
Update: I saw that my first answer throws some binding errors..
An other option is working with a converter (works, but a bit dirty ;-) ):
...
<Window.Resources>
<local:FloatConverter x:Key="FloatConverter" />
</Window.Resources>
...
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource FloatConverter}}"></TextBox>
Converter:
public class FloatConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
// return an invalid value in case of the value ends with a point
return value.ToString().EndsWith(".") ? "." : value;
}
}