From 5ee7cf2f2aef59d91d13efc426c47aae4d1a5248 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 22 Oct 2025 14:58:13 +0200 Subject: [PATCH] Update messages when a id is received to show green line --- ENI2/DetailRootControl.xaml.cs | 1 + ENI2/DetailViewControls/OverViewDetailControl.xaml.cs | 3 +++ ENI2/SucheControl.xaml.cs | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index 8ead1cd2..d6066145 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -226,6 +226,7 @@ namespace ENI2 public void CoreChanged(MessageCore newCore) { this.Core = newCore; + this.ReloadCore(); System.Windows.Application.Current.Dispatcher.Invoke(delegate { if(controlCache.ContainsKey(Properties.Resources.textOverview)) diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index b9b4f2df..6a850f5f 100644 --- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -357,6 +357,9 @@ namespace ENI2.DetailViewControls this.buttonExcelImport.IsEnabled = !this.Core.DisplayId.IsNullOrEmpty(); + this.dataGridMessages.ItemsSource = null; + this.dataGridMessages.ItemsSource = this.Messages; + //MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId)); //ShowIdDialog sid = new ShowIdDialog(this.Core) //{ diff --git a/ENI2/SucheControl.xaml.cs b/ENI2/SucheControl.xaml.cs index 1d63af8f..e013710d 100644 --- a/ENI2/SucheControl.xaml.cs +++ b/ENI2/SucheControl.xaml.cs @@ -102,7 +102,8 @@ namespace ENI2 private void ContextMenu_ContextMenuOpening(object sender, ContextMenuEventArgs e) { MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore; - cancelItem.Visibility = (this.AdminMode && (selectedCore.Cancelled ?? false)) ? Visibility.Visible : Visibility.Collapsed; + if(selectedCore != null) + cancelItem.Visibility = (this.AdminMode && (selectedCore.Cancelled ?? false)) ? Visibility.Visible : Visibility.Collapsed; } private void CancelItem_Click(object sender, RoutedEventArgs e)