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> </Grid.ColumnDefinitions>
<Image Margin="2" Grid.Column="0" PreviewMouseUp="Image_PreviewMouseUp" x:Name="imageShipcallType" /> <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" <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}"> <Grid Grid.Column="2" Background="{Binding Source={x:Static sets:Settings.Default}, Path=BG_COLOR}">
<Image Grid.Column="3" Margin="2" x:Name="imageEvaluation" /> <Image Grid.Column="3" Margin="2" x:Name="imageEvaluation" />
</Grid> </Grid>
@ -100,7 +102,7 @@
<!-- AGENCY --> <!-- 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"> <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> <Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" /> <ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" /> <ColumnDefinition Width="0.7*" />

View File

@ -170,7 +170,8 @@ namespace BreCalClient
this.labelShipName.Foreground = Brushes.LightYellow; 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) switch (this.ShipcallControlModel?.Shipcall?.Type)
{ {
case 1: // incoming case 1: // incoming
@ -201,23 +202,33 @@ namespace BreCalClient
break; 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 this.Background = Brushes.LightGray;
switch (resultColor) //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: ShipcallControlModel.TrafficLightMode resultColor = (ShipcallControlModel.TrafficLightMode)(this.ShipcallControlModel?.Shipcall?.Evaluation ?? 0); // der nullable Operator hier ist so doof, die VS validation blickts einfach nicht
// this.Background = Brushes.LightGreen; switch (resultColor)
// break; {
case ShipcallControlModel.TrafficLightMode.YELLOW: //case ShipcallControlModel.TrafficLightMode.GREEN:
this.Background= Brushes.LightYellow; // this.Background = Brushes.LightGreen;
break; // break;
case ShipcallControlModel.TrafficLightMode.RED: case ShipcallControlModel.TrafficLightMode.YELLOW:
this.Background = new SolidColorBrush(Color.FromArgb(200, 255, 100, 100)); this.Background = Brushes.LightYellow;
break; break;
default: case ShipcallControlModel.TrafficLightMode.RED:
this.Background = Brushes.Transparent; this.Background = new SolidColorBrush(Color.FromArgb(200, 255, 100, 100));
break; break;
default:
this.Background = Brushes.Transparent;
break;
}
} }
} }