UIElement.Effect Property

Gets or sets the pixel shader effect to use for rendering this UIElement.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property Effect As Effect
public Effect Effect { get; set; }
<uiElement>
  <uiElement.Effect>
    singleEffect
  </uiElement.Effect>
</uiElement>

XAML Values

Property Value

Type: System.Windows.Media.Effects.Effect
The pixel shader effect to use for rendering this UIElement. The default is nulla null reference (Nothing in Visual Basic) (no effects).

Remarks

Dependency property identifier field: EffectProperty

Examples of effects that can be applied are BlurEffect and DropShadowEffect.

Version Notes

Silverlight for Windows Phone Silverlight for Windows Phone

For Silverlight for Windows Phone, you need to set a CacheMode value in order to apply an Effect.

Examples

The following example shows a simple XAML definition of a BlurEffect value for Effect.

<StackPanel>
    <Button Content="You Can't Read This!"  Width="200">
        <Button.Effect>
            <BlurEffect Radius="10" />
        </Button.Effect>
    </Button>
</StackPanel>

For another example that shows how to define a custom shader-based effect and then apply it as a custom XAML element, see PixelShader.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.