Sign in

高翔 / ECS-ZJHX · Files

Logo

GitLab

  • Back to dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • ECS-ZJHX
  • HHECS.WinCommon
  • ValueRules
  • NotNullRule.cs
  • 参照扬子江中二线作为初版
    0f1853c6
    111 authored
    2026-03-06 09:47:13 +0800  
    Browse Code »
NotNullRule.cs 504 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
using System.Globalization;
using System.Windows.Controls;

namespace HHECS.WinCommon.ValueRules
{
    public class NotNullRule : ValidationRule
    {
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            if (value == null)
            {
                return new ValidationResult(false, "值不能为null");
            }
            else
            {
                return new ValidationResult(true, null);
            }
        }
    }
}