From 4c3eb7f334abb8129b57e86f2935d75d0b3070b4 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 03 三月 2025 18:55:31 +0800
Subject: [PATCH] 完善UI;新增TestResult;

---
 HMI.UI/DpUtil/FormGroupHelper.cs |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/HMI.UI/DpUtil/FormGroupHelper.cs b/HMI.UI/DpUtil/FormGroupHelper.cs
index 245a054..21c314e 100644
--- a/HMI.UI/DpUtil/FormGroupHelper.cs
+++ b/HMI.UI/DpUtil/FormGroupHelper.cs
@@ -1,11 +1,8 @@
-锘縰sing System;
-using System.ComponentModel;
+锘縰sing Panuon.WPF.UI;
 using System.Windows;
 using System.Windows.Controls;
-using Panuon.WPF.UI;
-using Panuon.WPF.UI.Configurations;
 
-namespace HMI.UI
+namespace HMI.UI.DpUtil
 {
     public class FormGroupHelper
     {
@@ -62,7 +59,7 @@
                 {
                     object content = fg.Content;
                     object value = GetValidateValue(content);
-                    if (GetIsRequired(fg) && string.IsNullOrEmpty(value.ToString()))
+                    if (value != null && GetIsRequired(fg) && string.IsNullOrEmpty(value.ToString()))
                     {
                         fg.ValidateResult = ValidateResult.Error;
                         fg.Message = $"{fg.Header}涓嶈兘涓虹┖";
@@ -93,6 +90,7 @@
             if (content is ComboBox cBox) return cBox.Text;
 
             if (content is Panel panel) return GetValidateValue(panel.Children);
+            if (content is NumberInput numberInput) return numberInput.Value;
             return null;
         }
     }

--
Gitblit v1.9.1