This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathPullRequestCreationView.xaml
More file actions
188 lines (171 loc) · 10.7 KB
/
Copy pathPullRequestCreationView.xaml
File metadata and controls
188 lines (171 loc) · 10.7 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
<local:GenericPullRequestCreationView x:Class="GitHub.VisualStudio.Views.GitHubPane.PullRequestCreationView"
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:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:local="clr-namespace:GitHub.VisualStudio.Views.GitHubPane"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="300"
Background="{DynamicResource GitHubVsToolWindowBackground}"
DataContext="{Binding ViewModel}"
IsEnabled="{Binding IsBusy, Converter={ghfvs:InverseBooleanConverter}}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestCreationViewCustom}"
mc:Ignorable="d">
<d:DesignProperties.DataContext>
<Binding>
<Binding.Source>
<ghfvs:PullRequestCreationViewModelDesigner />
</Binding.Source>
</Binding>
</d:DesignProperties.DataContext>
<Control.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio.UI;component/SharedDictionary.xaml" />
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI.Reactive;component/SharedDictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="CommitListItemContainerStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Margin" Value="5" />
<Setter Property="Padding" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border x:Name="Bd"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="GitHubPopupThing" TargetType="{x:Type ListBox}">
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding Path=Name}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<ghfvs:BranchNameConverter x:Key="BranchNameConverter" />
</ResourceDictionary>
</Control.Resources>
<Grid VerticalAlignment="Top"
MaxHeight="{Binding ActualHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:GenericPullRequestCreationView}}}"
Margin="0 8 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0">
<Grid Margin="10,-3,10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal">
<ghfvs:OcticonImage Foreground="{DynamicResource GitHubVsGrayText}" Icon="git_branch" />
<ghfvs:LinkDropDown Header="Target Branch"
ItemsSource="{Binding Branches}"
SelectedItem="{Binding TargetBranch}"
ToolTip="Select a branch"
Margin="0,1,0,0"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestTargetBranchComboBox}" >
<ghfvs:LinkDropDown.ItemTemplate>
<DataTemplate DataType="models:BranchModel">
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource BranchNameConverter}">
<Binding/>
<Binding Path="ViewModel.GitHubRepository" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:PullRequestCreationView}}" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</ghfvs:LinkDropDown.ItemTemplate>
<ghfvs:LinkDropDown.LinkItemTemplate>
<DataTemplate DataType="models:BranchModel">
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource BranchNameConverter}">
<Binding/>
<Binding Path="ViewModel.GitHubRepository" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:PullRequestCreationView}}" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</ghfvs:LinkDropDown.LinkItemTemplate>
</ghfvs:LinkDropDown>
<ghfvs:OcticonImage Height="13"
Margin="5,2,3,0"
VerticalAlignment="Center"
Foreground="{DynamicResource GitHubVsGrayText}"
Icon="chevron_left" />
</StackPanel>
<ghfvs:GitHubActionLink Margin="5,0,0,0"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Content="{Binding SourceBranch.Name}"
HasDropDown="False"
Grid.Column="1"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestSourceBranchHyperlink}"/>
</Grid>
</DockPanel>
<ghfvs:PromptTextBox x:Name="titleText"
Grid.Row="1"
Margin="10,5"
Text="{Binding PRTitle, UpdateSourceTrigger=PropertyChanged}"
PromptText="{x:Static ghfvs:Resources.TitleRequired}"
Style="{DynamicResource GitHubVsPromptTextBox}"
SpellCheck.IsEnabled="True"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestCreationTitleTextBox}"/>
<ghfvs:PromptTextBox Grid.Row="2"
MinHeight="100"
Margin="10,5"
AcceptsReturn="True"
PromptText="{x:Static ghfvs:Resources.Description}"
Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}"
Style="{DynamicResource GitHubVsPromptTextBox}"
VerticalScrollBarVisibility="Auto"
TextWrapping="Wrap"
SpellCheck.IsEnabled="True"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestCreationDescriptionTextBox}"/>
<ghfvs:ValidationMessage x:Name="titleValidationMessage"
Grid.Row="3"
Fill="{StaticResource GitHubWarningBrush}"
Icon="alert"
ValidatesControl="{Binding ElementName=titleText}"
ReactiveValidator="{Binding TitleValidator, Mode=OneWay}"/>
<DockPanel Grid.Row="4" Margin="10,10,10,20" HorizontalAlignment="Stretch">
<Button DockPanel.Dock="Right"
Margin="6,0,0,0"
HorizontalAlignment="Right"
Command="{Binding CreatePullRequest}"
Content="{x:Static ghfvs:Resources.CreatePullRequest}"
Style="{StaticResource GitHubVsPrimaryActionButton}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestCreationCreateButton}"/>
<Button DockPanel.Dock="Right"
HorizontalAlignment="Right"
Command="{Binding Cancel}"
Content="{x:Static ghfvs:Resources.CancelLink}"
Style="{StaticResource GitHubVsButton}"
AutomationProperties.AutomationId="{x:Static ghfvs:AutomationIDs.PullRequestCreationCancelButton}"/>
</DockPanel>
</Grid>
</local:GenericPullRequestCreationView>