I can Enter Numbers into the text box but it won't allow me to enter decimal values. May I ask why is this?
<TextBox Text="{Binding SebAmountPer, Mode=Twoway, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="2" TextWrapping="Wrap"/>
public decimal? SebAmountPer
{
get
{
return _seb.SEBAmountPer;
}
set
{
_seb.SEBAmountPer = value;
OnPropertyChanged("SebAmountPer");
OnPropertyChanged("SebTotal");
}
}
You have a two-way binding to a numeric datatype. The trigger is property change which means after every key stroke. Try binding to a string first or change update trigger.
You enter "2." and he updates the binding to 2.0 and converts it back and just steals away your dot ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With