Update messages when a id is received to show green line

This commit is contained in:
Daniel Schick 2025-10-22 14:58:13 +02:00
parent be78399def
commit 5ee7cf2f2a
3 changed files with 6 additions and 1 deletions

View File

@ -226,6 +226,7 @@ namespace ENI2
public void CoreChanged(MessageCore newCore) public void CoreChanged(MessageCore newCore)
{ {
this.Core = newCore; this.Core = newCore;
this.ReloadCore();
System.Windows.Application.Current.Dispatcher.Invoke(delegate System.Windows.Application.Current.Dispatcher.Invoke(delegate
{ {
if(controlCache.ContainsKey(Properties.Resources.textOverview)) if(controlCache.ContainsKey(Properties.Resources.textOverview))

View File

@ -357,6 +357,9 @@ namespace ENI2.DetailViewControls
this.buttonExcelImport.IsEnabled = !this.Core.DisplayId.IsNullOrEmpty(); 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)); //MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId));
//ShowIdDialog sid = new ShowIdDialog(this.Core) //ShowIdDialog sid = new ShowIdDialog(this.Core)
//{ //{

View File

@ -102,6 +102,7 @@ namespace ENI2
private void ContextMenu_ContextMenuOpening(object sender, ContextMenuEventArgs e) private void ContextMenu_ContextMenuOpening(object sender, ContextMenuEventArgs e)
{ {
MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore; MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore;
if(selectedCore != null)
cancelItem.Visibility = (this.AdminMode && (selectedCore.Cancelled ?? false)) ? Visibility.Visible : Visibility.Collapsed; cancelItem.Visibility = (this.AdminMode && (selectedCore.Cancelled ?? false)) ? Visibility.Visible : Visibility.Collapsed;
} }