基于Model的数据验证:INotifyPropertyChanged
1、Exception(并不是最终解决方案)
2、自定义ValidationRule(依赖属性与数据Model使用相同)
3、IDataErrorInfo
4、Validator扩展验证
依赖于特性:Required(必须输入的,不能空)、StringLength(字符长度)
Range(数值区间)、RegularExpression(正则,邮箱地址、手机号)、CustomValidation(自定义验证)
*5、Model的INotifyPropertyChanged接口简化特性(给大家推荐)
<Window x:Class="Zhaoxi.MVV