[]
You can add a drop shadow to a reflection using the standard Silverlight drop shadow effect. In this topic, you will add the drop shadow effect in Blend, in XAML, and in code.
At Design Time in Blend
To use the drop shadow effect, complete the following steps:
Add a C1Reflector control to your Blend project.
Select the C1Reflector control once to select it.
Under the Properties panel, click the ReflectionEffects ellipsis button to open the Effect Collection Editor: ReflectionEffects dialog box.
Click Add another item.
The Select Object dialog box opens.
Select DropShadowEffect from the list and then click OK to add the effect to the control and return to the Effect Collection Editor: ReflectionEffects dialog box.
In the Properties grid, set the following properties:
Set the BlurRadius property to "7".
Set the Direction property to "180".
Set the Opacity property to "95%".
Set the ShadowDepth to "8".
Press OK to close the Effect Collection Editor: ReflectionEffects dialog box.
At Design Time in Blend
To use the drop shadow effect, complete the following steps:
Add a C1Reflector control to your Blend project.
Add Content="C1Reflector" to the <c1ext:C1Reflector>
tag to set string content.
Add the drop shadow effect and set its properties by placing the following XAML between the <c1ext:C1Reflector>
and <c1ext:C1Reflector>
tags:
<c1ext:C1Reflector.ReflectionEffects>
<DropShadowEffect BlurRadius="7 Opacity="0.95" ShadowDepth="8" Direction="180"/>
</c1ext:C1Reflector.ReflectionEffects>
In Code
To use the drop shadow effect, complete the following steps:
Add a C1Reflector control to your Blend project.
Add Content="C1Reflector" to the <c1ext:C1Reflector>
tag to set string content.
Add x:Name=C1Reflector1 to the <c1ext:C1Reflector>
tag. This will give the control a unique identifier that you can use to call it in code.
Switch to Code view and import the following namespace:
Imports System.Windows.Media.Effects;
using System.Windows.Media.Effects;
Add the following beneath the InitializeComponent() method:
'Create the DropShadowEffect object and set its properties
Dim newDropShadowEffect As New DropShadowEffect() newDropShadowEffect.BlurRadius = 7
newDropShadowEffect.Direction = 180
newDropShadowEffect.Opacity = 95
newDropShadowEffect.ShadowDepth = 8
'Add the DropShadowEffect object to the C1Reflector control
C1Reflector1.ReflectionEffects.Add(newDropShadowEffect)
//Create the DropShadowEffect object and set its properties
DropShadowEffect newDropShadowEffect = new DropShadowEffect();
newDropShadowEffect.BlurRadius = 7;
newDropShadowEffect.Direction = 180;
newDropShadowEffect.Opacity = 95;
newDropShadowEffect.ShadowDepth = 8;
//Add the DropShadowEffect object to the C1Reflector control
C1Reflector1.ReflectionEffects.Add(newDropShadowEffect);
Run the program.
This Topic Illustrates the Following:
When you run the project, the C1Reflector control and its content will resemble the following image: