Extended Library for WPF and Silverlight | ComponentOne
Reflector (Silverlight Only) / Task-Based Help / Using the Blur Effect
In This Topic
    Using the Blur Effect
    In This Topic

    You can add a blur effect 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 blur effect, complete the following steps:

    1. Add a C1Reflector control to your Blend project.
    2. Select the C1Reflector control once to select it.
    3. Under the Properties panel, click the ReflectionEffects ellipsis button to open the Effect Collection Editor: ReflectionEffects dialog box.
    4. Click Add another item. The Select Object dialog box opens.
    5. Select BlurEffect from the list and then click OK to add the effect to the control and return to the Effect Collection Editor: ReflectionEffects dialog box.
    6. In the Properties grid, set the Radius property to "3".
    7. Press OK to close the Effect Collection Editor: ReflectionEffects dialog box.

    In XAML

    To use the blur effect, complete the following steps:

    1. Add a C1Reflector control to your Blend project.
    2. Add Content="C1Reflector" to the <c1ext:C1Reflector> tag to set string content.
    3. Add the blur effect and set its properties by placing the following XAML between the <c1ext:C1Reflector> and </c1ext:C1Reflector> tags:

        

    XAML
    Copy Code
    <c1ext:C1Reflector.ReflectionEffects>
    <BlurEffect Radius="3"/>
    </c1ext:C1Reflector.ReflectionEffects>
    
     

    In Code

    To use the blur effect, complete the following steps:

    1. Add a C1Reflector control to your Blend project.
    2. Add Content="C1Reflector" to the <c1ext:C1Reflector> tag to set string content.
    3. 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.
    4. Switch to Code view and import the following namespace:
    Visual Basic
    Copy Code
    Imports System.Windows.Media.Effects;
    

    C#
    Copy Code
    using System.Windows.Media.Effects;
    

     

     

    1. Add the following beneath the InitializeComponent() method:
    Visual Basic
    Copy Code
    'Create the BlurEffect object and set its Radius property
    Dim newBlurEffect As New BlurEffect() newBlurEffect.Radius = 3
    'Add the BlurEffect object to the C1Reflector control C1Reflector1.ReflectionEffects.Add(newBlur)
    

    C#
    Copy Code
    //Create the BlurEffect object and set its Radius property
    BlurEffect newBlurEffect = new BlurEffect();
    newBlurEffect.Radius = 3;
    //Add the BlurEffect object to the C1Reflector control
    C1Reflector1.ReflectionEffects.Add(newBlurEffect);
    

    1.  Run the program.

     This Topic Illustrates the Following:

    When you run the project, the C1Reflector control and its content will resemble the following image: