From 553b9131d483ae044dfa0f5c147808f81eb7b62a Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 8 Apr 2024 12:38:37 +0200 Subject: [PATCH] do not show undefined entry in shipcall type combobox --- src/BreCalClient/EditShipcallControl.xaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs index 45abafa..bbb6312 100644 --- a/src/BreCalClient/EditShipcallControl.xaml.cs +++ b/src/BreCalClient/EditShipcallControl.xaml.cs @@ -5,6 +5,7 @@ using BreCalClient.misc.Api; using BreCalClient.misc.Model; using System; +using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using static BreCalClient.Extensions; @@ -49,7 +50,15 @@ namespace BreCalClient this.comboBoxAgency.ItemsSource = BreCalLists.Participants_Agent; this.comboBoxShip.ItemsSource = BreCalLists.AllShips; - this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(ShipcallType)); + Array types = Enum.GetValues(typeof(ShipcallType)); + List shipcallTypes = new List(); + bool first = true; + foreach(ShipcallType shipcallType in types) + { + if (!first) shipcallTypes.Add(shipcallType); + else first = false; + } + this.comboBoxCategories.ItemsSource = shipcallTypes; this.comboBoxArrivalBerth.ItemsSource = BreCalLists.Berths; this.comboBoxDepartureBerth.ItemsSource = BreCalLists.Berths;