|
75 | 75 | Value="{DynamicResource ResourceKey=ExpanderDownHeader}" /> |
76 | 76 | </Style> |
77 | 77 |
|
| 78 | + <!-- Header style for bordered expanders (e.g. the ping monitor host): adds a small |
| 79 | + left margin so the chevron does not sit flush against the visible border. --> |
| 80 | + <Style x:Key="PingMonitorExpanderDownHeader" |
| 81 | + BasedOn="{StaticResource ResourceKey=MahApps.Styles.ToggleButton.ExpanderHeader.Down}" |
| 82 | + TargetType="{x:Type TypeName=ToggleButton}"> |
| 83 | + <Setter Property="Template"> |
| 84 | + <Setter.Value> |
| 85 | + <ControlTemplate TargetType="{x:Type TypeName=ToggleButton}"> |
| 86 | + <Border Padding="{TemplateBinding Property=Padding}" |
| 87 | + Background="{TemplateBinding Property=Background}" |
| 88 | + BorderBrush="{TemplateBinding Property=BorderBrush}" |
| 89 | + BorderThickness="{TemplateBinding Property=BorderThickness}"> |
| 90 | + <Grid Background="Transparent" SnapsToDevicePixels="False"> |
| 91 | + <Grid.ColumnDefinitions> |
| 92 | + <ColumnDefinition Width="Auto" /> |
| 93 | + <ColumnDefinition Width="*" /> |
| 94 | + </Grid.ColumnDefinitions> |
| 95 | + <Rectangle Grid.Column="0" Grid.Row="0" |
| 96 | + x:Name="Chevron" |
| 97 | + Width="16" Height="16" |
| 98 | + Margin="10,0,0,0" |
| 99 | + Fill="{DynamicResource ResourceKey=MahApps.Brushes.Gray3}" |
| 100 | + VerticalAlignment="Center"> |
| 101 | + <Rectangle.OpacityMask> |
| 102 | + <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronUp}" /> |
| 103 | + </Rectangle.OpacityMask> |
| 104 | + </Rectangle> |
| 105 | + <mahAppsControls:ContentControlEx Grid.Column="1" |
| 106 | + Margin="10,0,0,0" |
| 107 | + HorizontalAlignment="Stretch" |
| 108 | + Padding="{TemplateBinding Property=Padding}" |
| 109 | + HorizontalContentAlignment="{TemplateBinding Property=HorizontalContentAlignment}" |
| 110 | + VerticalContentAlignment="{TemplateBinding Property=VerticalContentAlignment}" |
| 111 | + Content="{TemplateBinding Property=Content}" |
| 112 | + ContentCharacterCasing="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(mahAppsControls:ControlsHelper.ContentCharacterCasing)}" |
| 113 | + ContentStringFormat="{TemplateBinding Property=ContentStringFormat}" |
| 114 | + ContentTemplate="{TemplateBinding Property=ContentTemplate}" |
| 115 | + ContentTemplateSelector="{TemplateBinding Property=ContentTemplateSelector}" |
| 116 | + RecognizesAccessKey="True" |
| 117 | + SnapsToDevicePixels="{TemplateBinding Property=SnapsToDevicePixels}" /> |
| 118 | + </Grid> |
| 119 | + </Border> |
| 120 | + <ControlTemplate.Triggers> |
| 121 | + <Trigger Property="IsChecked" Value="True"> |
| 122 | + <Setter TargetName="Chevron" Property="OpacityMask"> |
| 123 | + <Setter.Value> |
| 124 | + <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronDown}" /> |
| 125 | + </Setter.Value> |
| 126 | + </Setter> |
| 127 | + </Trigger> |
| 128 | + <Trigger Property="IsMouseOver" Value="True"> |
| 129 | + <Setter TargetName="Chevron" Property="Fill" |
| 130 | + Value="{DynamicResource ResourceKey=MahApps.Brushes.Gray5}" /> |
| 131 | + </Trigger> |
| 132 | + </ControlTemplate.Triggers> |
| 133 | + </ControlTemplate> |
| 134 | + </Setter.Value> |
| 135 | + </Setter> |
| 136 | + </Style> |
| 137 | + |
| 138 | + <!-- Expander variant for the ping monitor host (bordered) using the indented header. --> |
| 139 | + <Style x:Key="PingMonitorExpander" |
| 140 | + TargetType="{x:Type TypeName=Expander}" |
| 141 | + BasedOn="{StaticResource ResourceKey=DefaultExpander}"> |
| 142 | + <Setter Property="mahAppsControls:ExpanderHelper.HeaderDownStyle" |
| 143 | + Value="{DynamicResource ResourceKey=PingMonitorExpanderDownHeader}" /> |
| 144 | + </Style> |
| 145 | + |
78 | 146 | <Style x:Key="ProfileExpanderOpen" |
79 | 147 | BasedOn="{StaticResource ResourceKey=MahApps.Styles.ToggleButton.ExpanderHeader.Down}" |
80 | 148 | TargetType="{x:Type TypeName=ToggleButton}"> |
|
0 commit comments