From ddae95b784ded9a1fb0fdf6141c9b735ba1fde57 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 2 Dec 2024 08:24:37 +0100 Subject: [PATCH] Make pier filter combobox dependent on selected harbour --- src/BreCalClient/MainWindow.xaml.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index c3a4383..04e4427 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -374,8 +374,18 @@ namespace BreCalClient private void comboBoxPorts_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e) { this.searchFilterControl.SearchFilter.Ports.Clear(); + + List berths = new List(); foreach (Port port in comboBoxPorts.SelectedItems) + { this.searchFilterControl.SearchFilter.Ports.Add(port.Id); + berths.AddRange(BreCalLists.GetBerthsByPort(port.Id)); + } + // create list of berths from selected port(s) or return all berths + if (berths.Count == 0) + berths = BreCalLists.AllBerths; + this.searchFilterControl.SetBerths(berths); + this.SearchFilterControl_SearchFilterChanged(); }