Binding to double field with validation

前端 未结 6 938
时光说笑
时光说笑 2020-12-30 04:13

I\'m trying to bind TextBox to double property of some object with UpdateSourceTrigger=PropertyChanged. The goal is to immediately dur

6条回答
  •  时光取名叫无心
    2020-12-30 04:39

    Tried formatting the value with decimal places?

    It may be weird though since you will then always have N decimal places.

    
        
    
    

    If having fixed decimal places is not good enough, you may have to write a converter that treats the value as a string and converts it back to a double.

提交回复
热议问题