-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathTimingGrid.xaml
More file actions
215 lines (202 loc) · 12.1 KB
/
TimingGrid.xaml
File metadata and controls
215 lines (202 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:timingGridControl="clr-namespace:SecondMonitor.Timing.Presentation.Controls.TimingGridControl">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/WindowsControls;component/WPF/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="TextBoxStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource LightGrey01Brush}" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsLastLapBestLap}" Value="True">
<Setter Property="Background" Value="{StaticResource Green01Brush}" />
</DataTrigger>
<DataTrigger Binding="{Binding IsLastLapBestSessionLap}" Value="True">
<Setter Property="Background" Value="{StaticResource PurpleTimingBrush}" />
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsLapped}" Value="True" />
<Condition Binding="{Binding InPits}" Value="False" />
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="{StaticResource TimingLappedForegroundBrush}" />
</MultiDataTrigger>
<DataTrigger Binding="{Binding IsLapping, Mode=OneWay}" Value="True">
<Setter Property="Foreground" Value="{StaticResource DarkRed01Brush}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TextBoxStyleSector1" TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsLastSector1PersonalBest}" Value="True">
<Setter Property="Background" Value="{StaticResource Green01Brush}" />
</DataTrigger>
<DataTrigger Binding="{Binding IsLastSector1SessionBest}" Value="True">
<Setter Property="Background" Value="{StaticResource PurpleTimingBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TextBoxStyleLastLap" TargetType="TextBlock" BasedOn="{StaticResource TextBoxStyle}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsLastPlayerLapBetter}" Value="True"/>
<Condition Binding="{Binding ColorLapsColumns}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{StaticResource Green01Brush}" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsLastPlayerLapBetter}" Value="False"/>
<Condition Binding="{Binding ColorLapsColumns}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{StaticResource DarkRed01Brush}" />
</MultiDataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TextBoxStyleRating" TargetType="TextBlock" BasedOn="{StaticResource TextBoxStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsPlayersRatingBetter}" Value="True">
<Setter Property="Background" Value="{StaticResource Green01Brush}" />
</DataTrigger>
<DataTrigger Binding="{Binding IsPlayersRatingBetter}" Value="False">
<Setter Property="Background" Value="{StaticResource DarkRed01Brush}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TextBoxStylePace" TargetType="TextBlock" BasedOn="{StaticResource TextBoxStyle}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsPlayersPaceBetter}" Value="True"/>
<Condition Binding="{Binding ColorLapsColumns}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{StaticResource Green01Brush}" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsPlayersPaceBetter}" Value="False"/>
<Condition Binding="{Binding ColorLapsColumns}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{StaticResource DarkRed01Brush}" />
</MultiDataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TextBoxStyleSector2" TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsLastSector2PersonalBest}" Value="True">
<Setter Property="Background" Value="{StaticResource Green01Brush}" />
</DataTrigger>
<DataTrigger Binding="{Binding IsLastSector2SessionBest}" Value="True">
<Setter Property="Background" Value="{StaticResource PurpleTimingBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TextBoxStyleSector3" TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsLastSector3PersonalBest}" Value="True">
<Setter Property="Background" Value="{StaticResource Green01Brush}" />
</DataTrigger>
<DataTrigger Binding="{Binding IsLastSector3SessionBest}" Value="True">
<Setter Property="Background" Value="{StaticResource PurpleTimingBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TimingGridRowStyle" TargetType="{x:Type DataGridRow}">
<Setter Property="Background" Value="{StaticResource Anthracite01Brush}" />
<Setter Property="BorderBrush" Value="{StaticResource LightGrey02Brush}" />
<Setter Property="BorderThickness" Value="0.5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRow}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border x:Name="DGR_Border" Grid.Row="0"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True">
<DataGridCellsPresenter
ItemsPanel="{TemplateBinding ItemsPanel}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<Grid Grid.Row="1" Background="{StaticResource Anthracite01Brush}" Height="{Binding DataContext.GapHeight, RelativeSource={RelativeSource TemplatedParent}}"></Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Black" />
</Trigger>
<DataTrigger Binding="{Binding IsPlayer, Mode=OneWay}" Value="True">
<Setter Property="Background" Value="{StaticResource DarkGrey05Brush}" />
<Setter Property="Foreground" Value="{StaticResource LightGrey01Brush}" />
<Setter Property="FontSize" Value="21" />
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="BorderBrush" Value="{StaticResource PlayerOutLineColor}"/>
<Setter Property="BorderThickness" Value="3"/>
</DataTrigger>
<DataTrigger Binding="{Binding HasCustomOutline, Mode=OneWay}" Value="True">
<Setter Property="BorderBrush" Value="{Binding OutLineColor, Converter={StaticResource ColorDtoToSolidBrushConverter}, Mode=OneWay}"/>
<Setter Property="BorderThickness" Value="3"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsLapped, Mode=OneWay}" Value="True">
<Setter Property="Foreground" Value="{StaticResource TimingLappedForegroundBrush}" />
</DataTrigger>
<DataTrigger Binding="{Binding IsLapping, Mode=OneWay}" Value="True">
<Setter Property="Foreground" Value="{StaticResource DarkRed01Brush}" />
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding InPitsMoving}" Value="False" />
<Condition Binding="{Binding InPits}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource InPitsBrush}" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding InPitsMoving}" Value="True" />
<Condition Binding="{Binding InPits}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource InPitsMovingBrush}" />
</MultiDataTrigger>
</Style.Triggers>
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="{StaticResource LightGrey01Color}" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{StaticResource Anthracite01Color}" />
</Style.Resources>
</Style>
<Style x:Key="DataGridHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="{StaticResource LightGrey01Brush}" />
<Setter Property="Background" Value="{StaticResource DarkGrey01Brush}" />
<Setter Property="BorderBrush" Value="{StaticResource DarkGrey01Brush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
<Style TargetType="timingGridControl:TimingGrid">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Background" Value="{StaticResource Anthracite01Brush}"/>
<Setter Property="AutoGenerateColumns" Value="False"/>
<Setter Property="CanUserSortColumns" Value="False"/>
<Setter Property="CanUserReorderColumns" Value="False"/>
<Setter Property="Foreground" Value="{StaticResource LightGrey01Brush}"></Setter>
<Setter Property="ColumnHeaderStyle" Value="{StaticResource DataGridHeaderStyle}"/>
<Setter Property="HeadersVisibility" Value="Column"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="SelectionMode" Value="Single"/>
<Setter Property="SelectionUnit" Value="FullRow"/>
<Setter Property="FontSize" Value="{StaticResource TimingGridFontSize}"/>
<Setter Property="RowStyle" Value="{StaticResource TimingGridRowStyle}"/>
</Style>
</ResourceDictionary>