You update your property every time you change the value. When you enter . , it is written to your view model and updated.
eg. if you type 100. , round to 100 , so you will not see a single dot.
You have the ability to change this behavior:
use delayed binding:
<TextBox Text="{Binding Path=TransactionDetails.TransactionAmount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Delay=250}" Grid.Column="3" Grid.ColumnSpan="2" Grid.Row="5" x:Name="TextBoxAmount" />
change the value only if it differs from the saved one (I would recommend this for each binding):
private double _transactionAmount; public double TransactionAmount { get { return _transactionAmount; } set { if (_transactionAmount != value) { _transactionAmount = value; Notify("TransactionAmount"); } }
or use some kind of verification, for example. ValidatesOnExceptions.
Herm
source share