From 7b903bb86375e9df24a725288d1c876b8d2b0e61 Mon Sep 17 00:00:00 2001
From: chr <chr@mailcom>
Date: 星期一, 03 三月 2025 19:47:49 +0800
Subject: [PATCH] 整合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