I appear to have figured it out.
Note: This answer is for a Top-And-Bottom only drop shadow, not all the way around.
I created a Border
, as described in the question, and created a BorderBrush
as defined below:
<Border Grid.Row="1" BorderThickness="0,5,0,5">
<Border.BorderBrush>
<LinearGradientBrush StartPoint=".5,0" EndPoint=".5,1">
<GradientStop Color="Blue" Offset="0"/>
<GradientStop Color="Black" Offset=".03"/>
<GradientStop Color="Black" Offset=".98"/>
<GradientStop Color="Blue" Offset="1"/>
</LinearGradientBrush>
</Border.BorderBrush>
</Border>
Strangely enough, in order to get a similar effect on the top and bottom, I had to make the bottom GradientStop
closer to the edge than the top. I'm not sure why that is.
What this will do is if you have content on a Blue
border, it will create a top drop shadow stripe and a bottom drop shadow stripe. It works pretty well for me right now.
The StartPoint
/Endpoint
define a point at the top center and bottom center (halfway in on x, 0 y, then halfway in on x, 1 y). For, say, one on the left and right side, all you'd have to do is change the StartPoint
and EndPoints
to: StartPoint="0,.5" EndPoint="1,.5"
.
I'm not sure how to change it for all the way around. I think it may likely require going from the center (.5,.5)
to a corner (0,0)
, but I haven't gotten this to work yet.
Hope this helps someone else.