From f0c33868d221f2004e82dcf31802420c36beb8f6 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Wed, 4 Dec 2024 09:14:04 +0100 Subject: [PATCH] Do not run change port event handler during iinit --- src/BreCalClient/EditShipcallControl.xaml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs index 763994a..7d6a0ee 100644 --- a/src/BreCalClient/EditShipcallControl.xaml.cs +++ b/src/BreCalClient/EditShipcallControl.xaml.cs @@ -358,10 +358,10 @@ namespace BreCalClient this.comboBoxAgency.SelectedValue = this.ShipcallModel.AssignedParticipants[ParticipantType.AGENCY].ParticipantId; } } - - this.comboBoxHarbour.SelectionChanged += this.comboBoxHarbour_SelectionChanged; + if (BreCalLists.PortLookupDict.ContainsKey(this.ShipcallModel.Shipcall.PortId)) - this.comboBoxHarbour.SelectedValue = this.ShipcallModel.Shipcall.PortId; + this.comboBoxHarbour.SelectedValue = this.ShipcallModel.Shipcall.PortId; + this.comboBoxHarbour.SelectionChanged += this.comboBoxHarbour_SelectionChanged; this.comboBoxHarbour.IsEnabled = this.ShipcallModel.AllowPortChange; }