Sui*_*eep 11 c# wpf int nullable
模型
public int? SizeLength { get; set; }
Run Code Online (Sandbox Code Playgroud)
XAML
<TextBox Text="{Binding [someViewModel].SizeLength, Mode=TwoWay}"></TextBox>
Run Code Online (Sandbox Code Playgroud)
一旦用户尝试backspace或delete其中的值textbox
,一条消息Value '' cannot be converted
.
我可以知道它有什么问题吗?
小智 26
使用:
{Binding TargetNullValue=''}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4862 次 |
最近记录: |