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

Commit 460b394

Browse files
committed
Use explicit DataTemplate for GitHubDialogWindow
This ensures that the close glyph only appears once on the window.
1 parent 475c8fa commit 460b394

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

src/GitHub.VisualStudio.UI/Views/Dialog/GitHubDialogWindow.xaml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,16 @@
3939
<ResourceDictionary>
4040
<local:ViewLocator x:Key="viewLocator"/>
4141
<DataTemplate DataType="{x:Type ghfvs:ViewModelBase}">
42-
<Border BorderThickness="1" BorderBrush="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBorderBrushKey}}">
43-
<DockPanel>
44-
<!-- close button and padding -->
45-
<shellControls:GlyphButton x:Uid="button_Close"
42+
<ContentControl Content="{Binding Converter={StaticResource viewLocator}}"/>
43+
</DataTemplate>
44+
</ResourceDictionary>
45+
</Window.Resources>
46+
<Window.ContentTemplate>
47+
<DataTemplate>
48+
<Border BorderThickness="1" BorderBrush="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBorderBrushKey}}">
49+
<DockPanel>
50+
<!-- close button and padding -->
51+
<shellControls:GlyphButton x:Uid="button_Close"
4652
x:Name="CloseButton"
4753
DockPanel.Dock="Top"
4854
Width="46"
@@ -60,18 +66,17 @@
6066
PressedForeground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonDownGlyphBrushKey}}"
6167
PressedBorderBrush="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonDownBorderBrushKey}}"
6268
Click="CloseButton_Click">
63-
<Path x:Uid="path_CloseButton"
69+
<Path x:Uid="path_CloseButton"
6470
Width="16"
6571
Height="16"
6672
Fill="{Binding Path=(TextElement.Foreground), RelativeSource={RelativeSource Self}}"
6773
Data="F1M8.583,8L13,12.424 12.424,13 8,8.583 3.576,13 3,12.424 7.417,8 3,3.576 3.576,3 8,7.417 12.424,3 13,3.576z"/>
68-
</shellControls:GlyphButton>
69-
70-
<!-- content -->
71-
<ContentControl Content="{Binding Converter={StaticResource viewLocator}}"/>
72-
</DockPanel>
73-
</Border>
74-
</DataTemplate>
75-
</ResourceDictionary>
76-
</Window.Resources>
74+
</shellControls:GlyphButton>
75+
76+
<!-- content -->
77+
<ContentControl Content="{Binding Converter={StaticResource viewLocator}}"/>
78+
</DockPanel>
79+
</Border>
80+
</DataTemplate>
81+
</Window.ContentTemplate>
7782
</ui:DialogWindow>

0 commit comments

Comments
 (0)