In this article, I will show you, How to create Shadow of controls. Through this, we can show 3d view of control. First of all, I will apply this style on manually created designs like Ellipse, Rectangle etc. After that I will apply same things on controls. So, add a new window in the project. Add this code in between the <grid> ...</grid> section of xaml file.
<Rectangle Height="150" Width="150" Stroke="Black" StrokeThickness="2">
<Rectangle.BitmapEffect>
<DropShadowBitmapEffect Color="Black" Direction="-50" ShadowDepth="40" Softness=".8"/>
</Rectangle.BitmapEffect>
<Rectangle.Fill>
<ImageBrush ImageSource="apple.png"/>
</Rectangle.Fill>
</Rectangle>
BitmapEffect creates the shadow effect behind the object. In the above-mentioned code we have Direction attribute. With the help of Direction attribute we can show shadow of control at user defined position.
<Button Width="150" Margin="71,167,71,59">
<Button.BitmapEffect>
<DropShadowBitmapEffect Color="Black" Direction="-50" ShadowDepth="40" Softness=".7"/>
</Button.BitmapEffect>
<Image Source="apple.png" Stretch="Fill"/>
Code generates the following output