Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 6123b02

Browse files
committed
Use the ghfvs: xmlns where possible.
1 parent f72df0c commit 6123b02

File tree

2 files changed

+52
-60
lines changed

2 files changed

+52
-60
lines changed

src/GitHub.VisualStudio/Views/GitHubPane/PullRequestDetailView.xaml

Lines changed: 40 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,47 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5-
xmlns:cache="clr-namespace:GitHub.UI.Helpers;assembly=GitHub.UI"
6-
xmlns:controls="clr-namespace:GitHub.VisualStudio.UI.Controls;assembly=GitHub.VisualStudio.UI"
5+
xmlns:ghfvs="https://github.com/github/VisualStudio"
76
xmlns:local="clr-namespace:GitHub.VisualStudio.Views.GitHubPane"
87
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9-
xmlns:sampleData="clr-namespace:GitHub.SampleData;assembly=GitHub.App"
10-
xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
11-
xmlns:uir="clr-namespace:GitHub.UI;assembly=GitHub.UI.Reactive"
12-
xmlns:vm="clr-namespace:GitHub.ViewModels.GitHubPane;assembly=GitHub.App"
138
xmlns:prop="clr-namespace:GitHub.VisualStudio.UI;assembly=GitHub.VisualStudio.UI"
149
xmlns:markdig="clr-namespace:Markdig.Wpf;assembly=Markdig.Wpf"
10+
xmlns:vsui="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"
1511
Background="{DynamicResource GitHubVsToolWindowBackground}"
1612
Foreground="{DynamicResource GitHubVsWindowText}"
1713
DataContext="{Binding ViewModel}"
1814
d:DesignWidth="356"
1915
d:DesignHeight="800"
20-
mc:Ignorable="d"
21-
xmlns:vsui="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0">
16+
mc:Ignorable="d">
2217
<d:DesignProperties.DataContext>
2318
<Binding>
2419
<Binding.Source>
25-
<sampleData:PullRequestDetailViewModelDesigner SourceBranchDisplayName="shana/error-handling-a-ridiculously-long-branch-name-because-why-not"
20+
<ghfvs:PullRequestDetailViewModelDesigner SourceBranchDisplayName="shana/error-handling-a-ridiculously-long-branch-name-because-why-not"
2621
TargetBranchDisplayName="master-is-always-stable"
2722
CommentCount="10">
2823
<!--
29-
<sampleData:PullRequestDetailViewModelDesigner.CheckoutState>
30-
<sampleData:PullRequestCheckoutStateDesigner Caption="Checkout error-handling/>
31-
</sampleData:PullRequestDetailViewModelDesigner.CheckoutState>
24+
<ghfvs:PullRequestDetailViewModelDesigner.CheckoutState>
25+
<ghfvs:PullRequestCheckoutStateDesigner Caption="Checkout error-handling/>
26+
</ghfvs:PullRequestDetailViewModelDesigner.CheckoutState>
3227
-->
33-
<sampleData:PullRequestDetailViewModelDesigner.UpdateState>
34-
<sampleData:PullRequestUpdateStateDesigner CommitsAhead="0" CommitsBehind="0" UpToDate="True"/>
35-
</sampleData:PullRequestDetailViewModelDesigner.UpdateState>
36-
<sampleData:PullRequestDetailViewModelDesigner.OperationError>
28+
<ghfvs:PullRequestDetailViewModelDesigner.UpdateState>
29+
<ghfvs:PullRequestUpdateStateDesigner CommitsAhead="0" CommitsBehind="0" UpToDate="True"/>
30+
</ghfvs:PullRequestDetailViewModelDesigner.UpdateState>
31+
<ghfvs:PullRequestDetailViewModelDesigner.OperationError>
3732
Unable to connect to the internets over here!
38-
</sampleData:PullRequestDetailViewModelDesigner.OperationError>
39-
</sampleData:PullRequestDetailViewModelDesigner>
33+
</ghfvs:PullRequestDetailViewModelDesigner.OperationError>
34+
</ghfvs:PullRequestDetailViewModelDesigner>
4035
</Binding.Source>
4136
</Binding>
4237
</d:DesignProperties.DataContext>
4338

4439
<Control.Resources>
4540
<ResourceDictionary>
4641
<ResourceDictionary.MergedDictionaries>
47-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio.UI;component/SharedDictionary.xaml" />
48-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
49-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI.Reactive;component/SharedDictionary.xaml" />
50-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/Assets/Markdown.xaml" />
42+
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio.UI;component/SharedDictionary.xaml" />
43+
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
44+
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI.Reactive;component/SharedDictionary.xaml" />
45+
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/Assets/Markdown.xaml" />
5146
</ResourceDictionary.MergedDictionaries>
5247

5348
<Style x:Key="Separator" TargetType="Rectangle">
@@ -78,7 +73,7 @@
7873
<Setter Property="Foreground" Value="Red" />
7974
</Style>
8075

81-
<ui:AllCapsConverter x:Key="AllCaps"/>
76+
<ghfvs:AllCapsConverter x:Key="AllCaps"/>
8277
</ResourceDictionary>
8378
</Control.Resources>
8479

@@ -130,7 +125,7 @@
130125
<ColumnDefinition Width="*"/>
131126
</Grid.ColumnDefinitions>
132127

133-
<ui:OcticonImage Grid.Column="0" VerticalAlignment="Center" Icon="git_branch" Height="15" Opacity="0.5" Margin="0 0 3 0" />
128+
<ghfvs:OcticonImage Grid.Column="0" VerticalAlignment="Center" Icon="git_branch" Height="15" Opacity="0.5" Margin="0 0 3 0" />
134129
<Border Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" CornerRadius="2" Padding="5 1" Background="{DynamicResource GitHubBranchNameBackgroundBrush}">
135130
<TextBlock FontFamily="Consolas" TextTrimming="CharacterEllipsis" ToolTip="{Binding SourceBranchDisplayName, Mode=OneWay}" Text="{Binding SourceBranchDisplayName, Mode=OneWay}" />
136131
</Border>
@@ -150,54 +145,54 @@
150145
</Grid.ColumnDefinitions>
151146

152147
<TextBlock Grid.Column="0" Opacity="0.5" VerticalAlignment="Center"
153-
Text="{Binding Model.UpdatedAt, StringFormat={x:Static prop:Resources.UpdatedFormat}, Converter={ui:DurationToStringConverter}, Mode=OneWay}"/>
148+
Text="{Binding Model.UpdatedAt, StringFormat={x:Static prop:Resources.UpdatedFormat}, Converter={ghfvs:DurationToStringConverter}, Mode=OneWay}"/>
154149

155150
<Rectangle Grid.Column="1" Margin="5" Width="1" Height="12" VerticalAlignment="Top" Style="{DynamicResource Separator}" />
156151

157152
<!-- Checkout pull request button -->
158-
<ui:GitHubActionLink Command="{Binding Checkout}"
153+
<ghfvs:GitHubActionLink Command="{Binding Checkout}"
159154
Content="{Binding CheckoutState.Caption}"
160155
Grid.Column="2"
161156
VerticalAlignment="Center"
162157
TextTrimming="CharacterEllipsis"
163-
Visibility="{Binding CheckoutState, Converter={ui:NullToVisibilityConverter}}"
158+
Visibility="{Binding CheckoutState, Converter={ghfvs:NullToVisibilityConverter}}"
164159
ToolTip="{Binding CheckoutState.ToolTip}"
165160
ToolTipService.ShowOnDisabled="True"/>
166161

167162
<!-- Pull/push buttons -->
168163
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center"
169-
Visibility="{Binding UpdateState.UpToDate, FallbackValue=Collapsed, Converter={ui:BooleanToInverseVisibilityConverter}}">
170-
<ui:OcticonImage Icon="arrow_down"/>
164+
Visibility="{Binding UpdateState.UpToDate, FallbackValue=Collapsed, Converter={ghfvs:BooleanToInverseVisibilityConverter}}">
165+
<ghfvs:OcticonImage Icon="arrow_down"/>
171166
<TextBlock Text="{Binding UpdateState.CommitsBehind}" VerticalAlignment="Center"/>
172-
<ui:GitHubActionLink Content="Pull"
167+
<ghfvs:GitHubActionLink Content="Pull"
173168
Command="{Binding Pull}"
174169
Margin="4,0"
175170
ToolTip="{Binding UpdateState.PullToolTip}"
176171
ToolTipService.ShowOnDisabled="True"
177172
VerticalAlignment="Center"/>
178-
<ui:OcticonImage Icon="arrow_up"/>
173+
<ghfvs:OcticonImage Icon="arrow_up"/>
179174
<TextBlock Text="{Binding UpdateState.CommitsAhead}" VerticalAlignment="Center"/>
180-
<ui:GitHubActionLink Content="Push"
175+
<ghfvs:GitHubActionLink Content="Push"
181176
Command="{Binding Push}"
182177
Margin="4,0"
183178
ToolTip="{Binding UpdateState.PushToolTip}"
184179
ToolTipService.ShowOnDisabled="True"
185180
VerticalAlignment="Center"/>
186181
<!-- Sync submodules -->
187-
<ui:OcticonImage Icon="package"
188-
Visibility="{Binding UpdateState.SyncSubmodulesEnabled, FallbackValue=Collapsed, Converter={ui:BooleanToVisibilityConverter}}" />
182+
<ghfvs:OcticonImage Icon="package"
183+
Visibility="{Binding UpdateState.SyncSubmodulesEnabled, FallbackValue=Collapsed, Converter={ghfvs:BooleanToVisibilityConverter}}" />
189184
<TextBlock Margin="4 0 0 0" Text="{Binding UpdateState.SubmodulesToSync}" VerticalAlignment="Center"
190-
Visibility="{Binding UpdateState.SyncSubmodulesEnabled, FallbackValue=Collapsed, Converter={ui:BooleanToVisibilityConverter}}" />
191-
<ui:GitHubActionLink Content="Sync"
185+
Visibility="{Binding UpdateState.SyncSubmodulesEnabled, FallbackValue=Collapsed, Converter={ghfvs:BooleanToVisibilityConverter}}" />
186+
<ghfvs:GitHubActionLink Content="Sync"
192187
Command="{Binding SyncSubmodules}"
193188
Margin="4 0"
194189
ToolTip="{Binding UpdateState.SyncSubmodulesToolTip}"
195-
Visibility="{Binding UpdateState.SyncSubmodulesEnabled, FallbackValue=Collapsed, Converter={ui:BooleanToVisibilityConverter}}" />
190+
Visibility="{Binding UpdateState.SyncSubmodulesEnabled, FallbackValue=Collapsed, Converter={ghfvs:BooleanToVisibilityConverter}}" />
196191
</StackPanel>
197192

198193
<!-- Branch checked out and up-to-date -->
199194
<TextBlock Grid.Column="2" VerticalAlignment="Center" TextWrapping="Wrap"
200-
Visibility="{Binding UpdateState.UpToDate, FallbackValue=Collapsed, Converter={ui:BooleanToVisibilityConverter}}">
195+
Visibility="{Binding UpdateState.UpToDate, FallbackValue=Collapsed, Converter={ghfvs:BooleanToVisibilityConverter}}">
201196
<TextBlock.Style>
202197
<Style TargetType="TextBlock" BasedOn="{StaticResource CheckoutMessage}">
203198
<Setter Property="Visibility" Value="Collapsed"/>
@@ -214,7 +209,7 @@
214209
</Style.Triggers>
215210
</Style>
216211
</TextBlock.Style>
217-
<ui:OcticonImage Icon="check" Foreground="#6CC644" Margin="0 0 0 -4"/>
212+
<ghfvs:OcticonImage Icon="check" Foreground="#6CC644" Margin="0 0 0 -4"/>
218213
<Run Text="{x:Static prop:Resources.LocalBranchUpToDate}"/>
219214
</TextBlock>
220215
</Grid>
@@ -230,7 +225,7 @@
230225
VerticalAlignment="Center"
231226
TextWrapping="Wrap"
232227
Style="{StaticResource FlatReadOnlyTextBox}"
233-
Visibility="{Binding OperationError, Converter={ui:NullToVisibilityConverter}}"/>
228+
Visibility="{Binding OperationError, Converter={ghfvs:NullToVisibilityConverter}}"/>
234229
</Grid>
235230

236231
<Rectangle DockPanel.Dock="Top" Style="{StaticResource Separator}" Height="2" Margin="-8,5,-8,0"/>
@@ -254,7 +249,7 @@
254249

255250
<!-- Author and open time -->
256251
<StackPanel Margin="0 5 0 0" Orientation="Horizontal">
257-
<controls:AccountAvatar Account="{Binding Model.Author}"
252+
<ghfvs:AccountAvatar Account="{Binding Model.Author}"
258253
VerticalAlignment="Top"
259254
Width="16"
260255
Height="16"/>
@@ -272,18 +267,18 @@
272267
Markdown="{Binding Body}"/>
273268

274269
<!-- View conversation on GitHub -->
275-
<ui:GitHubActionLink Grid.Column="2" Grid.Row="2" Margin="0 6" Command="{Binding OpenOnGitHub}">
270+
<ghfvs:GitHubActionLink Grid.Column="2" Grid.Row="2" Margin="0 6" Command="{Binding OpenOnGitHub}">
276271
View conversation on GitHub
277-
</ui:GitHubActionLink>
272+
</ghfvs:GitHubActionLink>
278273

279274
<!-- Files changed -->
280-
<ui:SectionControl Name="changesSection"
275+
<ghfvs:SectionControl Name="changesSection"
281276
Grid.Row="4"
282277
IsExpanded="True"
283278
HeaderText="{Binding Files.ChangedFilesCount, StringFormat={x:Static prop:Resources.ChangesCountFormat}}"
284279
Margin="0 5 10 0">
285280
<local:PullRequestFilesView DataContext="{Binding Files}"/>
286-
</ui:SectionControl>
281+
</ghfvs:SectionControl>
287282
</Grid>
288283
</ScrollViewer>
289284
</DockPanel>

src/GitHub.VisualStudio/Views/GitHubPane/PullRequestFilesView.xaml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:cache="clr-namespace:GitHub.UI.Helpers;assembly=GitHub.UI"
7-
xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
8-
xmlns:vm="clr-namespace:GitHub.ViewModels.GitHubPane;assembly=GitHub.App"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:ghfvs="https://github.com/github/VisualStudio"
97
xmlns:prop="clr-namespace:GitHub.VisualStudio.UI;assembly=GitHub.VisualStudio.UI"
10-
xmlns:sample="clr-namespace:GitHub.SampleData;assembly=GitHub.App"
118
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"
129
Name="root">
1310

1411
<d:DesignProperties.DataContext>
15-
<sample:PullRequestFilesViewModelDesigner/>
12+
<ghfvs:PullRequestFilesViewModelDesigner/>
1613
</d:DesignProperties.DataContext>
1714

1815
<Control.Resources>
1916
<ResourceDictionary>
2017
<ResourceDictionary.MergedDictionaries>
21-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio.UI;component/SharedDictionary.xaml" />
22-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
23-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI.Reactive;component/SharedDictionary.xaml" />
24-
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/Assets/Markdown.xaml" />
18+
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio.UI;component/SharedDictionary.xaml" />
19+
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
20+
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI.Reactive;component/SharedDictionary.xaml" />
21+
<ghfvs:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/Assets/Markdown.xaml" />
2522
</ResourceDictionary.MergedDictionaries>
2623

2724
<ContextMenu x:Key="FileContextMenu">
@@ -49,15 +46,15 @@
4946
</Style>
5047
</TreeView.ItemContainerStyle>
5148
<TreeView.Resources>
52-
<HierarchicalDataTemplate DataType="{x:Type vm:PullRequestDirectoryNode}"
49+
<HierarchicalDataTemplate DataType="{x:Type ghfvs:PullRequestDirectoryNode}"
5350
ItemsSource="{Binding Children}">
5451
<StackPanel Orientation="Horizontal">
55-
<ui:OcticonImage Icon="file_directory" Foreground="{DynamicResource GitHubDirectoryIconForeground}" Margin="0,0,0,2"/>
52+
<ghfvs:OcticonImage Icon="file_directory" Foreground="{DynamicResource GitHubDirectoryIconForeground}" Margin="0,0,0,2"/>
5653
<TextBlock Text="{Binding DirectoryName}" Margin="4 2" VerticalAlignment="Center"/>
5754
</StackPanel>
5855
</HierarchicalDataTemplate>
5956

60-
<DataTemplate DataType="{x:Type vm:PullRequestFileNode}">
57+
<DataTemplate DataType="{x:Type ghfvs:PullRequestFileNode}">
6158
<StackPanel Orientation="Horizontal"
6259
Tag="{Binding DataContext, ElementName=root}"
6360
KeyboardNavigation.DirectionalNavigation="None">
@@ -81,7 +78,7 @@
8178
</Style.Triggers>
8279
</Style>
8380
</Decorator.Style>
84-
<ui:OcticonImage Icon="file_code" Margin="0,0,0,2"/>
81+
<ghfvs:OcticonImage Icon="file_code" Margin="0,0,0,2"/>
8582
</Decorator>
8683

8784
<TextBlock Text="{Binding FileName}" Margin="4 2" VerticalAlignment="Center">
@@ -125,7 +122,7 @@
125122
</Style.Triggers>
126123
</Style>
127124
</TextBlock.Style>
128-
<ui:OcticonImage Icon="comment_discussion" Height="10" Margin="-2 0"/>
125+
<ghfvs:OcticonImage Icon="comment_discussion" Height="10" Margin="-2 0"/>
129126
<Hyperlink Command="{Binding DataContext.OpenFirstComment, ElementName=root}"
130127
CommandParameter="{Binding}">
131128
<Run Text="{Binding CommentCount, Mode=OneWay}"/>

0 commit comments

Comments
 (0)