Show arrows for shipcall types

This commit is contained in:
Daniel Schick 2023-08-17 11:06:34 +02:00
parent 3d7906a9f2
commit 65ffea1b8c
2 changed files with 598 additions and 356 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,7 @@
xmlns:local="clr-namespace:BreCalClient"
xmlns:p = "clr-namespace:BreCalClient.Resources"
xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient"
xmlns:db2="clr-namespace:BreCalClient.misc.Model;assembly=BreCalClient"
mc:Ignorable="d"
d:DesignHeight="120" d:DesignWidth="800" Loaded="UserControl_Loaded">
<Border BorderBrush="LightGray" Margin="1" BorderThickness="1">
@ -29,7 +30,7 @@
<RowDefinition Height=".125*"/>
<RowDefinition Height=".125*"/>
<RowDefinition Height=".125*"/>
<RowDefinition Height=".05*"/>
<RowDefinition Height=".125*"/>
<RowDefinition Height=".125*"/>
@ -39,10 +40,32 @@
<ColumnDefinition Width=".4*" />
<ColumnDefinition Width=".6*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.RowSpan="1" Grid.ColumnSpan="2" FontSize="10" Content="{Binding Ship.Name}" Foreground="White" Background="#203864" VerticalAlignment="Stretch"
<Grid Grid.Row="0" Grid.Column="0" Grid.RowSpan="1" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Margin="2" Grid.Column="0" >
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="{Binding Shipcall.Type}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Shipcall.Type}" Value="{x:Static db2:Shipcall+TypeEnum.Incoming}">
<Setter Property="Source" Value="./Resources/arrow_down_red.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding Shipcall.Type}" Value="{x:Static db2:Shipcall+TypeEnum.Outgoing}">
<Setter Property="Source" Value="./Resources/arrow_up_green.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding Shipcall.Type}" Value="{x:Static db2:Shipcall+TypeEnum.Shifting}">
<Setter Property="Source" Value="./Resources/arrow_right_blue.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
<Label Grid.Column="1" FontSize="10" Content="{Binding Ship.Name}" Foreground="White" Background="#203864" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
</Grid>
<Viewbox Grid.Row="1" Grid.Column="0">
<TextBlock Text="IMO" />
</Viewbox>
@ -51,7 +74,7 @@
</Viewbox>
<Viewbox Grid.Row="2" Grid.Column="0">
<TextBlock Text="{x:Static p:Resources.textCallsign}" />
</Viewbox>
</Viewbox>
<Viewbox Grid.Row="2" Grid.Column="1">
<TextBlock Text="{Binding Ship.Callsign}" />
</Viewbox>
@ -86,7 +109,7 @@
<Viewbox Grid.Row="7" Grid.Column="1">
<TextBlock Text="{Binding Agency}" />
</Viewbox>
</Grid>
<Label Grid.Row="0" Grid.Column="1" Grid.RowSpan="1" FontSize="12" Content="- / -" Foreground="White" Background="#203864" VerticalAlignment="Stretch"