摘要: 要求:年龄不满18 就边框飘红 后台代码: public class AgeInfoWithValidation : IDataErrorInfo { public int Age { get; set; } public string this[string columnName] { get { 阅读全文
posted @ 2021-02-08 13:48 蜜铀 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 实现简单的年龄划分: 如果年龄小于18则显示:年龄:x,未成年人; 否则:年龄:x,成年人; 代码: [ValueConversion(typeof(int), typeof(String))] public class AgeConverter : IValueConverter { public 阅读全文
posted @ 2021-02-08 11:53 蜜铀 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 验证用户是否年满18+ public class AgeRule : ValidationRule { private Double limitAge = 18; public Double LimitAge { get { return limitAge; } set { limitAge = v 阅读全文
posted @ 2021-02-08 11:35 蜜铀 阅读(196) 评论(0) 推荐(0) 编辑