文章目录
问题描述:TextBox绑定了值,但当没有输入的时候,显示未能转换值""
解决方案:给绑定增加converter,
<TextBox Text="{Binding Count, Converter={StaticResource countConverter}}" />
要这样绑定先要写一个converter
C#代码:
using System.Windows.Data;
public class CountConverter :
解决方案:给绑定增加converter,
<TextBox Text="{Binding Count, Converter={StaticResource countConverter}}" />
要这样绑定先要写一个converter
C#代码:
using System.Windows.Data;
public class CountConverter :