In this example, I have a TextBlock
with a DropShadowEffect
:
<TextBlock Foreground="Black" Text="All Tasks">
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="1.2"
Direction="270"
Opacity="0.6"
BlurRadius="1"
Color="Red"/>
</TextBlock.Effect>
</TextBlock>
This produces the following output:
If I set any Background color for the TextBlock
, the shadow should disappear:
How can I set this property while keeping the drop shadow?
The DropShadowEffect
doesn't disappear - it now applies to the whole rectangle.
This gives the desired effect:
<Border Background="Green">
<TextBlock Foreground="Black" Text="All Tasks">
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="1.2"
Direction="270"
Opacity="0.6"
BlurRadius="1"
Color="Red"/>
</TextBlock.Effect>
</TextBlock>
</Border>