tags:

views:

38

answers:

1

Hello all,

I have a user control, MBControl. Here is the code:

<my:MBControl Name="MBControl" HorizontalAlignment="Center" VerticalAlignment="Center">
              <my:MBControl.BitmapEffect>
                <DropShadowBitmapEffect Color="Black" Direction="315"
                      Softness="0.5" ShadowDepth="10" Opacity="1" />
              </my:MBControl.BitmapEffect>
</my:MBControl>

The problem with the code is it seems like the shadow is applied to every child element of my user control. Or, possibly, it is dropped inside as well as outside -- the control surface is darker than without the shadow.

How could I fix this? I want the shadow being dropped outside only and not affecting the control surface.

UPDATE: I've got it! This effect is the result of the user control transparency. The shadow has a form of rectangle (like my user control's form). What I really want is a shadow with subtracted central area. This area has to be intersection of it's current shape and user control shape.

+1  A: 

Setting a non-transparent background color should suffice:

<my:MBControl ... Background="White">
    ...
</my:MBControl>
Heinzi