made cancelled row look cancelled

This commit is contained in:
Daniel Schick 2023-12-23 20:43:46 +01:00
parent 86e6c8caa7
commit ae349b3781
2 changed files with 31 additions and 18 deletions

View File

@ -46,7 +46,9 @@
</Grid.ColumnDefinitions>
<Image Margin="2" Grid.Column="0" PreviewMouseUp="Image_PreviewMouseUp" x:Name="imageShipcallType" />
<Label Grid.Column="1" FontSize="12" x:Name="labelShipName" Foreground="White" Background="{Binding Source={x:Static sets:Settings.Default}, Path=BG_COLOR}" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" PreviewMouseUp="Image_PreviewMouseUp"/>
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" PreviewMouseUp="Image_PreviewMouseUp">
<TextBlock Name="textBlockShipName" />
</Label>
<Grid Grid.Column="2" Background="{Binding Source={x:Static sets:Settings.Default}, Path=BG_COLOR}">
<Image Grid.Column="3" Margin="2" x:Name="imageEvaluation" />
</Grid>
@ -100,7 +102,7 @@
<!-- AGENCY -->
<Border Grid.Row="2" Grid.Column="1" BorderThickness="1, 0, 0, 0" BorderBrush="{Binding Source={x:Static sets:Settings.Default}, Path=BG_COLOR}" Padding="3,0,0,0">
<Grid>
<Grid Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />

View File

@ -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;
}
}
}