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

Commit 2da1349

Browse files
committed
Fix the styling of the checkbox so it binds properly
Fixes #62
1 parent e1bc0fa commit 2da1349

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

src/GitHub.VisualStudio/SharedDictionary.xaml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,14 @@
1010

1111
<Style x:Key="VSStyledButton" TargetType="{x:Type Button}" BasedOn="{StaticResource VsButtonStyleKey}">
1212
</Style>
13-
<Style x:Key="VSStyledCheckBox" TargetType="{x:Type CheckBox}">
14-
<Setter Property="Control.Template">
15-
<Setter.Value>
16-
<ControlTemplate TargetType="{x:Type CheckBox}">
17-
<CheckBox Foreground="{DynamicResource VsBrush.ToolWindowText}" Background="{DynamicResource VsBrush.ToolWindowBackground}">
18-
<TextBlock TextWrapping="Wrap" Foreground="{DynamicResource VsBrush.ToolWindowText}" Background="{DynamicResource VsBrush.ToolWindowBackground}">
19-
<TextBlock.Inlines>
20-
<Run Text="{TemplateBinding Content}" />
21-
</TextBlock.Inlines>
22-
</TextBlock>
23-
</CheckBox>
24-
<ControlTemplate.Triggers>
25-
<Trigger Property="UIElement.IsMouseOver" Value="true">
26-
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}"/>
27-
</Trigger>
28-
</ControlTemplate.Triggers>
29-
</ControlTemplate>
30-
</Setter.Value>
31-
</Setter>
13+
<Style x:Key="VSStyledCheckBox" BasedOn="{StaticResource VsCheckBoxStyleKey}" TargetType="{x:Type CheckBox}">
14+
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
15+
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
16+
<Style.Triggers>
17+
<Trigger Property="UIElement.IsMouseOver" Value="true">
18+
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}"/>
19+
</Trigger>
20+
</Style.Triggers>
3221
</Style>
3322
<Style x:Key="VSStyledComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource VsComboBoxStyleKey}">
3423
</Style>

src/GitHub.VisualStudio/UI/Views/Controls/RepositoryPublishControl.xaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,24 @@
123123

124124
<CheckBox x:Name="makePrivate"
125125
Margin="0,8,0,0"
126-
Style="{StaticResource VSStyledCheckBox}">Private Repository</CheckBox>
126+
Style="{StaticResource VSStyledCheckBox}">
127+
<TextBlock TextWrapping="Wrap"
128+
Foreground="{DynamicResource VsBrush.ToolWindowText}"
129+
Background="{DynamicResource VsBrush.ToolWindowBackground}">
130+
<TextBlock.Resources>
131+
<Style TargetType="{x:Type TextBlock}">
132+
<Style.Triggers>
133+
<Trigger Property="IsEnabled" Value="False">
134+
<Setter Property="Opacity" Value="0.5" />
135+
</Trigger>
136+
</Style.Triggers>
137+
</Style>
138+
</TextBlock.Resources>
139+
<TextBlock.Inlines>
140+
<Run>Private Repository</Run>
141+
</TextBlock.Inlines>
142+
</TextBlock>
143+
</CheckBox>
127144

128145
<Label x:Name="upgradeToMicroPlanWarning" HorizontalAlignment="Left" Visibility="Collapsed">
129146
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">

0 commit comments

Comments
 (0)