wpftoolkitlostfocus

wpf toolkit integer updown does not retain value on lostfocus


I have an integer updown wpf toolkit control. I am able to change the values using the arrow keys and able to type it explicitly. But after changing the value, if I move focus away the value become zero.

Any help would be appreciated. Thanks!

 <wpftlkit:IntegerUpDown Grid.Column="1" Margin="6" VerticalAlignment="Center" Increment="1" Maximum="7"
                         Value="{Binding ValueH,   Mode=TwoWay, UpdateSourceTrigger=LostFocus}"                              Style="{StaticResource StyleErrorTemplate}"
                        IsEnabled="{Binding IsEnabled}" Visibility="{Binding Visibility}" />

Solution

  • I suspect the issue is a binding issue. The actual value doesn't get updated until you lose focus (due to your UpdateSourceTrigger), at which point a broken binding or binding to a property that forces the value back to zero would give this behavior.