TextBox雙向綁定int屬性,清空輸入框時Setter方法未觸發。
我的解決方案:
1、屬性置為int?;
2、xmlns:sys="clr-namespace:System;assembly=mscorlib"
3、Text="{Binding Number,Mode=TwoWay,TargetNullValue={x:Static sys:String.Empty},UpdateSourceTrigger=PropertyChanged}"
TextBox雙向綁定int屬性,清空輸入框時Setter方法未觸發。
我的解決方案:
1、屬性置為int?;
2、xmlns:sys="clr-namespace:System;assembly=mscorlib"
3、Text="{Binding Number,Mode=TwoWay,TargetNullValue={x:Static sys:String.Empty},UpdateSourceTrigger=PropertyChanged}"
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。