From 79ddbf15727effa94054c7a851cef27c64774540 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 28 Jan 2026 08:35:41 +0100 Subject: [PATCH] Added a manual grid refresh after validation since this seems not to work automatically anymore --- ENI2/DetailRootControl.xaml.cs | 52 +++++++++++-------- .../OverViewDetailControl.xaml.cs | 13 +++-- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index e6910ef1..ee6bf533 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -838,7 +838,7 @@ namespace ENI2 { List vViolations = new List(); List vErrors = new List(); - Dictionary counts = new Dictionary(); + Dictionary counts = new Dictionary(); RuleEngine ruleEngine = new RuleEngine(); foreach (Message aMessage in messagesSnapshot) @@ -855,7 +855,7 @@ namespace ENI2 ViolationCount = violations.Count > 0 ? (int?)violations.Count : null, PositionViolationCount = violations.Count > 0 ? (int?)violations.Count(v => !v.Identifier.IsNullOrEmpty()) : null }; - counts[aMessage] = messageCounts; + counts[aMessage] = messageCounts; string messageGroup = this.MessageGroupForMessage(aMessage); @@ -1393,20 +1393,20 @@ namespace ENI2 } } - return new ValidationResult(vViolations, vErrors, counts); - } + return new ValidationResult(vViolations, vErrors, counts); + } private void ApplyValidationResult(ValidationResult result, bool showMessages) { // TODO: clear highlighting - foreach (KeyValuePair entry in result.Counts) - { - Message aMessage = entry.Key; - MessageValidationCounts messageCounts = entry.Value; - aMessage.ErrorCount = messageCounts.ErrorCount; - aMessage.ViolationCount = messageCounts.ViolationCount; - aMessage.PositionViolationCount = messageCounts.PositionViolationCount; - } + foreach (KeyValuePair entry in result.Counts) + { + Message aMessage = entry.Key; + MessageValidationCounts messageCounts = entry.Value; + aMessage.ErrorCount = messageCounts.ErrorCount; + aMessage.ViolationCount = messageCounts.ViolationCount; + aMessage.PositionViolationCount = messageCounts.PositionViolationCount; + } foreach (MessageError me in result.Errors) { @@ -1461,6 +1461,12 @@ namespace ENI2 MessageBox.Show(Properties.Resources.textValidationOK, Properties.Resources.textValidation, MessageBoxButton.OK, MessageBoxImage.Information); } } + + if (controlCache.TryGetValue(Properties.Resources.textOverview, out DetailBaseControl overviewControl) && + overviewControl is OverViewDetailControl ovdc) + { + ovdc.RefreshMessageGrid(); + } } private void ApplyCrewEffectsWarningSuppression() @@ -1486,17 +1492,17 @@ namespace ENI2 private sealed class ValidationResult { - internal ValidationResult(List violations, List errors, Dictionary counts) - { - Violations = violations; - Errors = errors; - Counts = counts; - } - - internal List Violations { get; } - internal List Errors { get; } - internal Dictionary Counts { get; } - } + internal ValidationResult(List violations, List errors, Dictionary counts) + { + Violations = violations; + Errors = errors; + Counts = counts; + } + + internal List Violations { get; } + internal List Errors { get; } + internal Dictionary Counts { get; } + } private sealed class MessageValidationCounts { diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index 6a850f5f..cc97db5f 100644 --- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -341,8 +341,8 @@ namespace ENI2.DetailViewControls } } - public void UpdateCore() - { + public void UpdateCore() + { this.UnregisterTextboxChange(this.textBoxDisplayId); this.textBoxDisplayId.DataContext = null; @@ -367,8 +367,13 @@ namespace ENI2.DetailViewControls //}; //sid.UpdateId(this.Core.DisplayId); //sid.Show(); - this.Core.IsDirty = false; // ist ja schon gespeichert.. - } + this.Core.IsDirty = false; // ist ja schon gespeichert.. + } + + internal void RefreshMessageGrid() + { + this.dataGridMessages?.Items?.Refresh(); + } #endregion