From 1f73238216242341718ca6495e466ccab4ec931c Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Tue, 9 Jun 2026 12:38:20 +0200 Subject: [PATCH] [chore:] adapt button enabeling to existance of PersonErrors --- MainWindow.axaml.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs index 56b8f36..384ece8 100644 --- a/MainWindow.axaml.cs +++ b/MainWindow.axaml.cs @@ -698,10 +698,23 @@ public partial class MainWindow : Window BtnCheck.IsEnabled = true; BtnCombine.IsEnabled = true; BtnGenerateLabels.IsEnabled = true; - BtnShorten.IsEnabled = true; + + // check for existing errors, otherwise disable the features + foreach(KasPerson pers in (LstCustomerAdressSets.SelectedItem as KasAddressList).KasPersons) + if (pers.PersonError != null) + { + BtnShorten.IsEnabled = true; + // BtnRepair.IsEnabled = true; + break; + } + else + { + BtnShorten.IsEnabled = false; + BtnRepair.IsEnabled = false; + } - // BtnRepair.IsEnabled = true; - // BtnShorten.IsEnabled = true; + + } }