|
95 | 95 | <Setter Property="Template"> |
96 | 96 | <Setter.Value> |
97 | 97 | <ControlTemplate TargetType="ToggleButton"> |
98 | | - <wpf:Ripple Padding="{TemplateBinding Padding}" |
99 | | - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
100 | | - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
101 | | - Content="{TemplateBinding Content}" |
102 | | - ContentTemplate="{TemplateBinding ContentTemplate}" |
103 | | - ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" |
104 | | - Focusable="False" |
105 | | - SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
| 98 | + <Grid> |
| 99 | + <Border x:Name="border" |
| 100 | + Background="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=Background}" |
| 101 | + BorderBrush="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=BorderBrush}" |
| 102 | + BorderThickness="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=BorderThickness}" |
| 103 | + CornerRadius="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=(wpf:ButtonAssist.CornerRadius)}" /> |
| 104 | + |
| 105 | + <wpf:Ripple Padding="{TemplateBinding Padding}" |
| 106 | + ClipToBounds="True" |
| 107 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 108 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 109 | + Content="{TemplateBinding Content}" |
| 110 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 111 | + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" |
| 112 | + Focusable="False" |
| 113 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"> |
| 114 | + <wpf:Ripple.Clip> |
| 115 | + <MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}"> |
| 116 | + <Binding ElementName="border" Path="ActualWidth" /> |
| 117 | + <Binding ElementName="border" Path="ActualHeight" /> |
| 118 | + <Binding ElementName="border" Path="CornerRadius" /> |
| 119 | + <Binding ElementName="border" Path="BorderThickness" /> |
| 120 | + </MultiBinding> |
| 121 | + </wpf:Ripple.Clip> |
| 122 | + </wpf:Ripple> |
| 123 | + </Grid> |
| 124 | + <ControlTemplate.Triggers> |
| 125 | + <Trigger Property="IsMouseOver" Value="true"> |
| 126 | + <Setter TargetName="border" Property="Background" Value="{Binding Foreground, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={x:Static converters:BrushOpacityConverter.Instance}, ConverterParameter=0.16}" /> |
| 127 | + </Trigger> |
| 128 | + <Trigger Property="IsEnabled" Value="false"> |
| 129 | + <Setter Property="Opacity" Value="0.38" /> |
| 130 | + </Trigger> |
| 131 | + </ControlTemplate.Triggers> |
106 | 132 | </ControlTemplate> |
107 | 133 | </Setter.Value> |
108 | 134 | </Setter> |
|
0 commit comments