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

Commit 0d6bc17

Browse files
committed
Set DataTriggers for AddInlineCommentGlyph
1 parent ec64672 commit 0d6bc17

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

src/GitHub.InlineReviews/Tags/AddInlineCommentGlyph.xaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,32 @@
66
mc:Ignorable="d">
77
<UserControl.Resources>
88
<SolidColorBrush x:Key="DiffChangeBackground" Color="DarkSlateGray" />
9+
<SolidColorBrush x:Key="AddDiffChangeBackground" Color="Green" />
10+
<SolidColorBrush x:Key="RemovedDiffChangeBackground" Color="Red" />
911
</UserControl.Resources>
1012

11-
<!-- This is just an exmaple showing where DiffChangeType is exposed -->
12-
<UserControl.ToolTip>
13-
<TextBlock Text="{Binding DiffChangeType}" />
14-
</UserControl.ToolTip>
15-
<!-- ^ delete me ^ -->
16-
1713
<Grid Background="{DynamicResource DiffChangeBackground}">
1814
<Viewbox x:Name="AddViewbox">
19-
<Path Stroke="Black"
20-
Data="M13 2H1c-0.55 0-1 0.45-1 1v8c0 0.55 0.45 1 1 1h2v3.5l3.5-3.5h6.5c0.55 0 1-0.45 1-1V3c0-0.55-0.45-1-1-1z m0 9H6L4 13V11H1V3h12v8z M7,5 L7,9 M5,7 L9,7"/>
15+
<Path
16+
Data="M13 2H1c-0.55 0-1 0.45-1 1v8c0 0.55 0.45 1 1 1h2v3.5l3.5-3.5h6.5c0.55 0 1-0.45 1-1V3c0-0.55-0.45-1-1-1z m0 9H6L4 13V11H1V3h12v8z M7,5 L7,9 M5,7 L9,7">
17+
<Path.Style>
18+
<Style TargetType="Path">
19+
<Style.Triggers>
20+
<DataTrigger Binding="{Binding DiffChangeType}" Value="Add">
21+
<Setter Property="Stroke" Value="{DynamicResource AddDiffChangeBackground}" />
22+
</DataTrigger>
23+
24+
<DataTrigger Binding="{Binding DiffChangeType}" Value="None">
25+
<Setter Property="Stroke" Value="{DynamicResource DiffChangeBackground}" />
26+
</DataTrigger>
27+
28+
<DataTrigger Binding="{Binding DiffChangeType}" Value="Delete">
29+
<Setter Property="Stroke" Value="{DynamicResource RemovedDiffChangeBackground}" />
30+
</DataTrigger>
31+
</Style.Triggers>
32+
</Style>
33+
</Path.Style>
34+
</Path>
2135
</Viewbox>
2236
</Grid>
2337
</UserControl>

0 commit comments

Comments
 (0)