Export (0) Print
Expand All

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)

public Effect Effect { get; set; }
<uiElement>
  <uiElement.Effect>
    singleEffect
  </uiElement.Effect>
</uiElement>

XAML Values

singleEffect

A single object element for an object that derives from Effect. Typically this is a BlurEffect or DropShadowEffect.

Property Value

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

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.

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.

Silverlight

Supported in: 5, 4, 3

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

Community Additions

ADD
Show:
© 2014 Microsoft