What I want is shadow only from outside of the button border and no shadow from inside. Is there a way to do it in button Style?
https://stackoverflow.com/a/11124369/7402089
Found what I needed, but shadow is both from inside and outside of the border.
I was trying to search among DropShadowEffect
properties and Border
properties or search on the internet, but I didn't find anything.
<Style x:Key="GlowingBorder" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Margin="10" Background="Transparent"
BorderBrush="#171e25" BorderThickness="1" Opacity="1.0"
CornerRadius="{TemplateBinding Border.CornerRadius}">
<Border.Effect>
<DropShadowEffect ShadowDepth="0"
Color="#72f4aa"
Opacity="1"
BlurRadius="6"/>
</Border.Effect>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Expected: shadow from outside, no shadow from inside of the border. Filled button with border color.
Current result: shadow both from inside and outside of the border. Foreground
and Background
properties inside Style
have no effect and Context
of button doesn't show neither. Don't know why.
How can I fix it?