This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathRepositoryCreationView.xaml
More file actions
256 lines (231 loc) · 12.9 KB
/
Copy pathRepositoryCreationView.xaml
File metadata and controls
256 lines (231 loc) · 12.9 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
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
<local:GenericRepositoryCreationView x:Class="GitHub.VisualStudio.Views.Dialog.RepositoryCreationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ghfvs="https://github.com/github/VisualStudio"
xmlns:controls="clr-namespace:GitHub.VisualStudio.UI.Controls"
xmlns:local="clr-namespace:GitHub.VisualStudio.Views.Dialog"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="440"
d:DesignWidth="414"
Style="{DynamicResource DialogUserControl}"
mc:Ignorable="d"
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.RepositoryCreationControlCustom}" >
<d:DesignProperties.DataContext>
<Binding>
<Binding.Source>
<ghfvs:RepositoryCreationViewModelDesigner />
</Binding.Source>
</Binding>
</d:DesignProperties.DataContext>
<Control.Resources>
<ResourceDictionary Source="DialogStyles.xaml" />
</Control.Resources>
<DockPanel Style="{DynamicResource DialogContainerDockPanel}">
<ghfvs:OcticonImage Margin="0,-20,0,-10"
Panel.ZIndex="100"
DockPanel.Dock="Top"
Icon="logo_github"
Style="{DynamicResource GitHubLogo}" />
<Button x:Name="createRepositoryButton"
Margin="0"
HorizontalAlignment="Center"
DockPanel.Dock="Bottom"
IsDefault="True"
Content="{x:Static ghfvs:Resources.CreateLink}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.CreateRepositoryButton}" >
</Button>
<StackPanel>
<StackPanel.Resources>
<Style BasedOn="{StaticResource {x:Type ghfvs:UserErrorMessages}}" TargetType="{x:Type ghfvs:UserErrorMessages}">
<Setter Property="IconMargin" Value="-1,2,7,0" />
<Setter Property="ErrorMessageFontWeight" Value="Normal" />
<Setter Property="Icon" Value="stop" />
<Setter Property="Margin" Value="0,5,0,0" />
</Style>
</StackPanel.Resources>
<controls:HorizontalShadowDivider />
<Grid x:Name="loginStackPanel"
Margin="30,-10,30,10"
FocusManager.IsFocusScope="True"
FocusVisualStyle="{x:Null}">
<Grid.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="0,3,0,3" />
</Style>
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource {x:Type Label}}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Margin" Value="0,0,10,0" />
<Setter Property="Padding" Value="0" />
</Style>
<Style TargetType="{x:Type ghfvs:PromptTextBox}" BasedOn="{StaticResource {x:Type ghfvs:PromptTextBox}}">
<Setter Property="Margin" Value="0,5" />
</Style>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Padding" Value="0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="35" />
<RowDefinition Height="*" />
<RowDefinition Height="35" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Row="0"
Grid.Column="0"
Content="{x:Static ghfvs:Resources.nameText}"
Target="{Binding ElementName=nameText}" />
<ghfvs:PromptTextBox x:Name="nameText"
Grid.Row="0"
Grid.Column="1"
MaxLength="{x:Static ghfvs:Constants.MaxRepositoryNameLength}"
Text="{Binding RepositoryName, UpdateSourceTrigger=PropertyChanged}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.RepositoryNameTextBox}" />
<StackPanel Grid.Row="1" Grid.Column="1">
<ghfvs:ValidationMessage x:Name="nameValidationMessage"
Style="{DynamicResource InlineValidationMessage}"
ValidatesControl="{Binding ElementName=nameText}"
ReactiveValidator="{Binding RepositoryNameValidator, Mode=OneWay}"/>
<ghfvs:ValidationMessage x:Name="safeRepositoryNameWarning"
ErrorAdornerTemplate="None"
Fill="#f39c12"
Icon="alert"
Style="{DynamicResource InlineValidationMessage}"
ValidatesControl="{Binding ElementName=nameText}"
ReactiveValidator="{Binding SafeRepositoryNameWarningValidator, Mode=OneWay}" />
</StackPanel>
<Label Grid.Row="2"
Grid.Column="0"
Content="{x:Static ghfvs:Resources.Description}"
Target="{Binding ElementName=description}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.RepositoryDescriptionTextBlock}" />
<ghfvs:PromptTextBox x:Name="description"
Grid.Row="2"
Grid.Column="1"
Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}"
SpellCheck.IsEnabled="True"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.RepositoryDescriptionTextBox}" />
<Label Grid.Row="3"
Grid.Column="0"
Content="{x:Static ghfvs:Resources.localPathText}"
Target="{Binding ElementName=localPathText}" />
<Grid Grid.Row="3" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ghfvs:PromptTextBox x:Name="localPathText"
Grid.Row="0"
Grid.Column="0"
Text="{Binding BaseRepositoryPath, UpdateSourceTrigger=PropertyChanged}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.CreateRepositoryLocalPathTextBox}" />
<Button x:Name="browsePathButton"
Grid.Row="0"
Grid.Column="1"
Margin="3,0,0,0"
VerticalContentAlignment="Center"
Content="{x:Static ghfvs:Resources.browsePathButtonContent}"
Padding="0"
Style="{DynamicResource GitHubLinkButton}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.CreateRepositoryLocalPathBrowseButton}" />
</Grid>
<ghfvs:ValidationMessage x:Name="pathValidationMessage"
Grid.Row="4"
Grid.Column="1"
Style="{DynamicResource InlineValidationMessage}"
ValidatesControl="{Binding ElementName=localPathText}"
ReactiveValidator="{Binding BaseRepositoryPathValidator, Mode=OneWay}" />
<Label Grid.Row="5"
Grid.Column="0"
Content="{x:Static ghfvs:Resources.ignoreTemplateListText}"
Target="{Binding ElementName=ignoreTemplateList}" />
<ComboBox x:Name="ignoreTemplateList"
Grid.Row="5"
Grid.Column="1"
ItemsSource="{Binding GitIgnoreTemplates}"
SelectedItem="{Binding SelectedGitIgnoreTemplate}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.GitignoreComboBox}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock x:Name="itemName" FontWeight="{Binding Recommended, Converter={ghfvs:BooleanToFontWeightConverter}}" Text="{Binding Name}" />
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBoxItem}}" Value="{x:Null}">
<Setter TargetName="itemName" Property="FontWeight" Value="Normal" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Label Grid.Row="6"
Grid.Column="0"
Content="{x:Static ghfvs:Resources.licenseListText}"
Target="{Binding ElementName=licenseList}" />
<ComboBox x:Name="licenseList"
Grid.Row="6"
Grid.Column="1"
ItemsSource="{Binding Licenses}"
SelectedItem="{Binding SelectedLicense}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.LicenseComboBox}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock x:Name="itemName" FontWeight="{Binding Recommended, Converter={ghfvs:BooleanToFontWeightConverter}}" Text="{Binding Name}" />
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBoxItem}}" Value="{x:Null}">
<Setter TargetName="itemName" Property="FontWeight" Value="Normal" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<controls:HorizontalShadowDivider Grid.Row="7" Grid.ColumnSpan="2" Margin="0,12" />
<ComboBox x:Name="accountsComboBox"
Grid.Row="8"
Grid.Column="1"
Margin="0,0,0,8"
ItemsSource="{Binding Accounts}"
SelectedItem="{Binding SelectedAccount}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.AccountComboBox}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Width="16"
Height="16"
Margin="0,0,8,0"
RenderOptions.BitmapScalingMode="HighQuality"
Source="{Binding Avatar}" />
<TextBlock Text="{Binding Login}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<CheckBox x:Name="makePrivate"
Grid.Row="9"
Grid.Column="1"
Content="{x:Static ghfvs:Resources.makePrivateContent}"
Padding="8,0,0,0"
IsChecked="{Binding KeepPrivate}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PrivateRepositoryCheckBox}" />
</Grid>
<ghfvs:UserErrorMessages x:Name="userErrorMessages"
Margin="0"
HorizontalAlignment="Center"
HorizontalContentAlignment="Stretch" />
</StackPanel>
</DockPanel>
</local:GenericRepositoryCreationView>