From 2915fbc12cec947a139ad72fc3111853f8c54fe8 Mon Sep 17 00:00:00 2001
From: "harald.martini@student.tugraz.at" <harald.martini@student.tugraz.at>
Date: Wed, 2 Jun 2021 10:38:15 +0200
Subject: [PATCH] Added Alternating background to passenger heatpumps

---
 .../MultistageParameterComboBoxView.xaml      |  2 +-
 .../ManufacturingStageAuxiliariesView.xaml    | 24 +++++++++++++++----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml
index 10606ac8fa..04884c5f67 100644
--- a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml
+++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml
@@ -52,7 +52,7 @@
                 <Label DockPanel.Dock="Right" x:Name="label2" Grid.Column="4"
                        Content="{Binding DummyContent, Converter={StaticResource SIToUnitStringConverter}}">
                 </Label>
-                <ComboBox DockPanel.Dock="Left" x:Name="comboBoxCurrent"  HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0" 
+                <ComboBox DockPanel.Dock="Left" x:Name="comboBoxCurrent"  HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 0 0" 
                           SelectedValue="{Binding CurrentContent,
                                 Mode=TwoWay, 
                                 ValidatesOnExceptions=True, 
diff --git a/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml b/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml
index d7be002ca9..ec56c65695 100644
--- a/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml
+++ b/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml
@@ -42,7 +42,7 @@
                         <StackPanel Margin="0">
                             <Label Margin="0" Style="{DynamicResource LabelStyle1}">Heat Pumps Passenger Compartment</Label>
                             <Label Padding="10 4 0 4" Style="{DynamicResource LabelStyle1}">Consolidated Data</Label>
-                            <ItemsControl 
+                            <ItemsControl AlternationCount="2"
                         Visibility="{Binding ConsolidatedHeatPumpConfigurationsPassenger, Converter={StaticResource NullToVisibilityConverter}}" 
                         ItemsSource="{Binding ConsolidatedHeatPumpConfigurationsPassenger}" 
                         HorizontalContentAlignment="Stretch"
@@ -50,13 +50,21 @@
                                 <ItemsControl.ItemTemplate>
                                     <DataTemplate>
                                         <Border BorderThickness="1">
-                                            <DockPanel LastChildFill="true">
+                                            <DockPanel LastChildFill="true" x:Name="ItemsDockPanel">
                                                 <UniformGrid DockPanel.Dock="Left" Columns="2">
                                                     <ContentControl Grid.Column="0" DockPanel.Dock="Top" Content="{Binding Path=HeatPumpTypeVM}"/>
                                                     <ContentControl Grid.Column="1" DockPanel.Dock="Top" Content="{Binding Path=HeatPumpModeVM}"/>
                                                 </UniformGrid>
                                             </DockPanel>
                                         </Border>
+                                        <DataTemplate.Triggers>
+                                            <Trigger Property="ItemsControl.AlternationIndex" Value="0">
+                                                <Setter Property="Background" Value="White" TargetName="ItemsDockPanel"/>
+                                            </Trigger>
+                                            <Trigger Property="ItemsControl.AlternationIndex" Value="1">
+                                                <Setter Property="Background" Value="LightGray" TargetName="ItemsDockPanel"/>
+                                            </Trigger>
+                                        </DataTemplate.Triggers>
                                     </DataTemplate>
                                 </ItemsControl.ItemTemplate>
                             </ItemsControl>
@@ -72,11 +80,11 @@
                             </DockPanel>
 
                             <ItemsControl ItemsSource="{Binding HeatPumpConfigurationsPassenger}" HorizontalContentAlignment="Stretch"
-                                  Padding="5">
+                                  Padding="5" AlternationCount="2">
                                 <ItemsControl.ItemTemplate>
                                     <DataTemplate>
                                         <Border BorderThickness="1">
-                                            <DockPanel LastChildFill="true">
+                                            <DockPanel LastChildFill="true" x:Name="ItemsDockPanel">
                                                 <Button DockPanel.Dock="Right" Height="24"
                                                 ContentTemplate="{DynamicResource TrashIcon}"
                                                 Command="{Binding RelativeSource={RelativeSource AncestorType=ItemsControl}, 
@@ -88,6 +96,14 @@
                                                 </UniformGrid>
                                             </DockPanel>
                                         </Border>
+                                        <DataTemplate.Triggers>
+                                            <Trigger Property="ItemsControl.AlternationIndex" Value="0">
+                                                <Setter Property="Background" Value="White" TargetName="ItemsDockPanel"/>
+                                            </Trigger>
+                                            <Trigger Property="ItemsControl.AlternationIndex" Value="1">
+                                                <Setter Property="Background" Value="LightGray" TargetName="ItemsDockPanel"/>
+                                            </Trigger>
+                                        </DataTemplate.Triggers>
                                     </DataTemplate>
                                 </ItemsControl.ItemTemplate>
                             </ItemsControl>
-- 
GitLab