-
Notifications
You must be signed in to change notification settings - Fork 0
/
WorkItemImportWizard.xaml
308 lines (282 loc) · 16.7 KB
/
WorkItemImportWizard.xaml
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<Window x:Class="Microsoft.VisualStudio.TestTools.WorkItemMigrator.WorkItemImportWizard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:WorkItemMigrator="clr-namespace:Microsoft.VisualStudio.TestTools.WorkItemMigrator"
x:ClassModifier="internal"
Title="{Binding Title}"
Background="{DynamicResource WizardBackgroundColor}"
ResizeMode="CanMinimize"
PreviewKeyDown="Window_PreviewKeyDown"
PreviewMouseDown="Window_PreviewMouseDown"
FocusableChanged="Window_FocusableChanged"
StateChanged="Window_StateChanged"
Height="600"
Closing="Window_Closing"
Width="750">
<Window.Resources>
<!-- Converters -->
<WorkItemMigrator:WizardPartToVisualConverter x:Key="WizardPartToVisualConverter" />
<WorkItemMigrator:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
<WorkItemMigrator:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<WorkItemMigrator:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" />
<WorkItemMigrator:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<Style x:Key="NavigationButtonStyle"
TargetType="{x:Type Button}">
<Setter Property="Padding" Value="7" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border Name="Border"
CornerRadius="0"
Margin="0"
BorderThickness="0,0,1,0"
Background="{DynamicResource NavigationPanelControlBackgroundColor}"
BorderBrush="{DynamicResource WizardBorderBrush}">
<Border BorderBrush="Transparent"
BorderThickness="0,0.6,0,0.6"
Name="MouseOverBorder">
<Border BorderThickness="0,0.1,0,0.1"
Padding="3"
Name="InnerBorder"
BorderBrush="{DynamicResource WizardBorderGradientBrush}">
<TextBlock Text="{Binding Header}"
FontSize="13"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding Header}"
Margin="8,4,2,2">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Foreground" Value="Black" />
<Style.Triggers>
<DataTrigger Binding="{Binding CanShow}"
Value="False">
<Setter Property="Foreground" Value="#FFC0C0C0" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Border>
</Border>
</Border>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding IsActiveWizardPart}"
Value="True">
<Setter TargetName="Border"
Property="Background"
Value="{DynamicResource WizardPageBackgroundColor}" />
<Setter TargetName="Border"
Property="BorderThickness"
Value="2,1,0,1" />
<Setter TargetName="InnerBorder"
Property="BorderThickness"
Value="0" />
<Setter TargetName="Border"
Property="CornerRadius"
Value="3,3,0,3" />
<Setter TargetName="Border"
Property="Margin"
Value="-3,0,0,0" />
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
Value="True" />
<Condition Binding="{Binding IsActiveWizardPart}"
Value="False" />
</MultiDataTrigger.Conditions>
<Setter TargetName="MouseOverBorder"
Property="BorderBrush"
Value="{DynamicResource WizardBorderBrush}" />
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="WizardNavigationPanelItemTemplate">
<Button x:Name="WizardNavigationButton"
Style="{StaticResource NavigationButtonStyle}"
IsEnabled="{Binding CanShow}"
Click="WizardNavigationButton_Click" />
</DataTemplate>
</Window.Resources>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0"
Margin="2,1,0,0"
BorderBrush="{DynamicResource WizardPageOuterBorderBrush}"
BorderThickness="0,4,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ItemsControl Grid.Row="0"
ItemsSource="{Binding WizardParts}"
ItemTemplate="{StaticResource WizardNavigationPanelItemTemplate}" />
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0"
BorderBrush="{DynamicResource WizardBorderBrush}"
BorderThickness="0,0,1,0">
<Grid>
<Polygon Points="0,0 0,4 1,5 2,6 137,50 143,50 143,0"
Fill="{DynamicResource NavigationPanelControlBackgroundColor}" />
<Polygon Points="137,50 138,51 139,52 139,52.5 139,228 143,228 143,50"
Fill="{DynamicResource WizardPageOuterBorderBrush}" />
</Grid>
</Border>
<Polygon Grid.Row="1"
Points="139,0 139,3 140,4 140,5 144,5 144,0"
Fill="{DynamicResource WizardPageOuterBorderBrush}" />
</Grid>
</Grid>
</Border>
<Border Grid.Column="1"
Margin="0,1,0,0"
BorderBrush="{DynamicResource WizardPageOuterBorderBrush}"
BorderThickness="0,4,4,4">
<Border BorderBrush="{DynamicResource WizardBorderBrush}"
BorderThickness="0,1,1,1"
Background="{DynamicResource WizardPageBackgroundColor}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0"
VerticalAlignment="Top"
Margin="7,8,10,0">
<TextBlock Text="{Binding WizardPart.Header, Mode=OneWay}"
FontWeight="Bold"
FontSize="16"/>
<TextBlock Text="{Binding WizardPart.Description}"
Margin="10,5,0,5"
Visibility="{Binding WizardPart.Description, Converter={StaticResource StringToVisibilityConverter}}"
TextWrapping="Wrap"/>
</StackPanel>
<Separator Grid.Row="1"
VerticalAlignment="Top"
Margin="7,7,7,0"/>
<ContentPresenter Grid.Row="2"
Margin="11,5,11,5"
Content="{Binding WizardPart, Converter={StaticResource WizardPartToVisualConverter}}"/>
<StatusBar Grid.Row="3"
Height="24"
BorderThickness="0,1,0,0"
BorderBrush="{DynamicResource StatusBorderColor}"
Background="{DynamicResource StatusBackgroundColor}">
<Grid Visibility="{Binding WizardPart.Warning, Converter={StaticResource StringToVisibilityConverter}}"
VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Height="16"
Width="16"
Grid.Column="0"
VerticalAlignment="Center"
Margin="3,0,3,0"
Source="{DynamicResource Warning_16}" />
<TextBlock Text="{Binding WizardPart.Warning, Mode=TwoWay}"
TextWrapping="Wrap"
VerticalAlignment="Center"
Grid.Column="1" />
</Grid>
</StatusBar>
</Grid>
</Border>
</Border>
</Grid>
</Border>
<Grid Grid.Row="1"
VerticalAlignment="Bottom"
Margin="7,14,7,7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
x:Uid="HelpButton"
Style="{DynamicResource NavigationButton}"
Name="HelpButton"
Content="Help"
Click="HelpButton_Click" />
<StackPanel Grid.Column="1"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button Name="BackButton"
x:Uid="BackButton"
Content="< _Back"
Style="{DynamicResource NavigationButton}"
IsEnabled="{Binding WizardPart.CanBack}"
Visibility="{Binding IsSummaryPage, Converter={StaticResource InverseBooleanToVisibilityConverter}}"
Click="BackButton_Click" />
<Button Name="NextButton"
x:Uid="NextButton"
Content="_Next >"
Style="{DynamicResource NavigationButton}"
Visibility="{Binding IsConfirmVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
IsEnabled="{Binding WizardPart.CanNext}"
Click="NextButton_Click" />
<Button Name="ConfirmButton"
x:Uid="ConfirmButton"
Style="{DynamicResource NavigationButton}"
Content="_Confirm >>"
Visibility="{Binding IsConfirmVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
IsEnabled="{Binding WizardInfo.CanConfirm}"
Click="ConfirmButton_Click" />
<Button Name="SaveandExitButton"
x:Uid="SaveandExitButton"
Style="{DynamicResource NavigationButton}"
Content="_Save and exit"
IsEnabled="{Binding CanSave}"
Visibility="{Binding IsConfirmPage, Converter={StaticResource BooleanToVisibilityConverter}}"
Click="SaveandExitButton_Click" />
<Button Name="SaveAndMigrateButton"
x:Uid="SaveAndMigrateButton"
Style="{DynamicResource NavigationButton}"
Content="Save and _migrate"
Visibility="{Binding IsConfirmPage, Converter={StaticResource BooleanToVisibilityConverter}}"
Click="SaveAndMigrateButton_Click" />
<Button Name="StartAgainButton"
x:Uid="StartAgainButton"
Style="{DynamicResource NavigationButton}"
Content="S_tart again"
IsEnabled="{Binding CanStartAgain}"
Visibility="{Binding IsSummaryPage, Converter={StaticResource BooleanToVisibilityConverter}}"
Click="StartAgainButton_Click" />
<Button Name="CloseButton"
x:Uid="CloseButton"
Style="{DynamicResource NavigationButton}"
Content="_Close"
Visibility="{Binding IsSummaryPage, Converter={StaticResource BooleanToVisibilityConverter}}"
Click="CloseButton_Click" />
<Button Name="CancelButton"
x:Uid="CancelButton"
Style="{DynamicResource NavigationButton}"
Visibility="{Binding IsSummaryPage, Converter={StaticResource InverseBooleanToVisibilityConverter}}"
Content="_Cancel"
Click="CancelButton_Click" />
</StackPanel>
</Grid>
</Grid>
</Window>