| | |
| | | using System; |
| | | using System.ComponentModel; |
| | | using 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 |
| | | { |
| | |
| | | { |
| | | 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}不能为空"; |
| | |
| | | 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; |
| | | } |
| | | } |