From ae349b3781e7767c17487b957c84e778d7f799bb Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sat, 23 Dec 2023 20:43:46 +0100 Subject: [PATCH] made cancelled row look cancelled --- src/BreCalClient/ShipcallControl.xaml | 6 ++-- src/BreCalClient/ShipcallControl.xaml.cs | 43 +++++++++++++++--------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/BreCalClient/ShipcallControl.xaml b/src/BreCalClient/ShipcallControl.xaml index c3b9155..3aee29c 100644 --- a/src/BreCalClient/ShipcallControl.xaml +++ b/src/BreCalClient/ShipcallControl.xaml @@ -46,7 +46,9 @@ @@ -100,7 +102,7 @@ - + diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs index 79cefa9..cfae5cb 100644 --- a/src/BreCalClient/ShipcallControl.xaml.cs +++ b/src/BreCalClient/ShipcallControl.xaml.cs @@ -170,7 +170,8 @@ namespace BreCalClient this.labelShipName.Foreground = Brushes.LightYellow; } - this.labelShipName.Content = this.ShipcallControlModel?.Ship?.Name; + this.textBlockShipName.Text = this.ShipcallControlModel?.Ship?.Name; + // this.labelShipName.Content = this.ShipcallControlModel?.Ship?.Name; switch (this.ShipcallControlModel?.Shipcall?.Type) { case 1: // incoming @@ -201,23 +202,33 @@ namespace BreCalClient break; } - if (this.ShipcallControlModel?.Shipcall?.Evaluation != null) + if (this.ShipcallControlModel?.Shipcall?.Canceled ?? false) { - ShipcallControlModel.TrafficLightMode resultColor = (ShipcallControlModel.TrafficLightMode) (this.ShipcallControlModel?.Shipcall?.Evaluation ?? 0); // der nullable Operator hier ist so doof, die VS validation blickts einfach nicht - switch (resultColor) + this.Background = Brushes.LightGray; + //this.Foreground = Brushes.DarkGray; + this.labelShipName.Foreground = Brushes.LightGray; + this.textBlockShipName.TextDecorations.Add(TextDecorations.Strikethrough); + } + else + { + if (this.ShipcallControlModel?.Shipcall?.Evaluation != null) { - //case ShipcallControlModel.TrafficLightMode.GREEN: - // this.Background = Brushes.LightGreen; - // break; - case ShipcallControlModel.TrafficLightMode.YELLOW: - this.Background= Brushes.LightYellow; - break; - case ShipcallControlModel.TrafficLightMode.RED: - this.Background = new SolidColorBrush(Color.FromArgb(200, 255, 100, 100)); - break; - default: - this.Background = Brushes.Transparent; - break; + ShipcallControlModel.TrafficLightMode resultColor = (ShipcallControlModel.TrafficLightMode)(this.ShipcallControlModel?.Shipcall?.Evaluation ?? 0); // der nullable Operator hier ist so doof, die VS validation blickts einfach nicht + switch (resultColor) + { + //case ShipcallControlModel.TrafficLightMode.GREEN: + // this.Background = Brushes.LightGreen; + // break; + case ShipcallControlModel.TrafficLightMode.YELLOW: + this.Background = Brushes.LightYellow; + break; + case ShipcallControlModel.TrafficLightMode.RED: + this.Background = new SolidColorBrush(Color.FromArgb(200, 255, 100, 100)); + break; + default: + this.Background = Brushes.Transparent; + break; + } } }