|
46 | 46 | <Setter Property="Margin"
|
47 | 47 | Value="0" />
|
48 | 48 | </Style>
|
| 49 | + |
| 50 | + <Style x:Key="expanderDownHeaderStyle" TargetType="{x:Type ToggleButton}"> |
| 51 | + <Setter Property="Template"> |
| 52 | + <Setter.Value> |
| 53 | + <ControlTemplate TargetType="{x:Type ToggleButton}"> |
| 54 | + <Border Padding="{TemplateBinding Padding}" Style="{StaticResource repositoryBorderStyle}"> |
| 55 | + <StackPanel Orientation="Horizontal" Background="#F8F8F8"> |
| 56 | + <ui:OcticonImage x:Name="arrow" Icon="triangle_right" Foreground="Black" Height="10" Margin="5,0,0,0" /> |
| 57 | + <ContentPresenter HorizontalAlignment="Left" Margin="0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/> |
| 58 | + </StackPanel> |
| 59 | + </Border> |
| 60 | + |
| 61 | + <ControlTemplate.Triggers> |
| 62 | + <Trigger Property="IsChecked" Value="True"> |
| 63 | + <Setter TargetName="arrow" Property="Icon" Value="triangle_down" /> |
| 64 | + </Trigger> |
| 65 | + </ControlTemplate.Triggers> |
| 66 | + </ControlTemplate> |
| 67 | + </Setter.Value> |
| 68 | + </Setter> |
| 69 | + </Style> |
| 70 | + |
| 71 | + <Style x:Key="ExpanderHeaderFocusVisual"> |
| 72 | + <Setter Property="Control.Template"> |
| 73 | + <Setter.Value> |
| 74 | + <ControlTemplate> |
| 75 | + <Border> |
| 76 | + <Rectangle Margin="0" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2"/> |
| 77 | + </Border> |
| 78 | + </ControlTemplate> |
| 79 | + </Setter.Value> |
| 80 | + </Setter> |
| 81 | + </Style> |
| 82 | + |
| 83 | + <Style x:Key="cloneGroupExpander" TargetType="{x:Type Expander}"> |
| 84 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> |
| 85 | + <Setter Property="Background" Value="Transparent"/> |
| 86 | + <Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
| 87 | + <Setter Property="VerticalContentAlignment" Value="Stretch"/> |
| 88 | + <Setter Property="BorderBrush" Value="Transparent"/> |
| 89 | + <Setter Property="BorderThickness" Value="0"/> |
| 90 | + <Setter Property="Template"> |
| 91 | + <Setter.Value> |
| 92 | + <ControlTemplate TargetType="{x:Type Expander}"> |
| 93 | + <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true"> |
| 94 | + <DockPanel> |
| 95 | + <ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" Content="{TemplateBinding Header}" DockPanel.Dock="Top" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="0" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{StaticResource expanderDownHeaderStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> |
| 96 | + <ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
| 97 | + </DockPanel> |
| 98 | + </Border> |
| 99 | + <ControlTemplate.Triggers> |
| 100 | + <Trigger Property="IsExpanded" Value="true"> |
| 101 | + <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/> |
| 102 | + </Trigger> |
| 103 | + <Trigger Property="IsEnabled" Value="false"> |
| 104 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> |
| 105 | + </Trigger> |
| 106 | + </ControlTemplate.Triggers> |
| 107 | + </ControlTemplate> |
| 108 | + </Setter.Value> |
| 109 | + </Setter> |
| 110 | + </Style> |
49 | 111 | </DockPanel.Resources>
|
50 | 112 |
|
51 | 113 | <ui:FilterTextBox x:Name="filterText"
|
|
152 | 214 | <Setter Property="Template">
|
153 | 215 | <Setter.Value>
|
154 | 216 | <ControlTemplate TargetType="{x:Type GroupItem}">
|
155 |
| - <Expander IsExpanded="{Binding Name.IsExpanded}"> |
| 217 | + <Expander Style="{StaticResource cloneGroupExpander}" IsExpanded="{Binding Name.IsExpanded}"> |
156 | 218 | <Expander.Header>
|
157 |
| - <Border Background="#F8F8F8" |
158 |
| - Style="{StaticResource repositoryBorderStyle}"> |
159 |
| - <StackPanel Orientation="Horizontal" |
160 |
| - VerticalAlignment="Center" |
161 |
| - Margin="0"> |
162 |
| - <Image x:Name="avatar" |
163 |
| - Width="16" |
164 |
| - Height="16" |
165 |
| - Margin="10,0,6,0" |
166 |
| - RenderOptions.BitmapScalingMode="HighQuality" |
167 |
| - Source="{Binding Items[0].Owner.Avatar}" /> |
168 |
| - <TextBlock Text="{Binding Path=Name.Header}" |
169 |
| - Style="{StaticResource cloneRepoHeaderStyle}" /> |
170 |
| - </StackPanel> |
| 219 | + <Border Style="{StaticResource repositoryBorderStyle}"> |
| 220 | + <StackPanel Orientation="Horizontal" |
| 221 | + VerticalAlignment="Center" |
| 222 | + Margin="0"> |
| 223 | + <Image x:Name="avatar" |
| 224 | + Width="16" |
| 225 | + Height="16" |
| 226 | + Margin="0,0,5,0" |
| 227 | + RenderOptions.BitmapScalingMode="HighQuality" |
| 228 | + Source="{Binding Items[0].Owner.Avatar}" /> |
| 229 | + <TextBlock Text="{Binding Path=Name.Header}" |
| 230 | + Style="{StaticResource cloneRepoHeaderStyle}" /> |
| 231 | + </StackPanel> |
171 | 232 | </Border>
|
172 | 233 | </Expander.Header>
|
173 | 234 | <ItemsPresenter Margin="0" />
|
|
0 commit comments