Skip to main content
.NET Framework Class Library
UIElementEffect Property

Gets or sets the bitmap effect to apply to the UIElement. This is a dependency property.

Namespace:   System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)
Syntax
Public Property Effect As [%$TOPIC/cc489982_en-us_VS_110_2_0_0_0_0%]
public [%$TOPIC/cc489982_en-us_VS_110_2_0_1_0_0%] Effect { get; set; }
public:
property [%$TOPIC/cc489982_en-us_VS_110_2_0_2_0_0%]^ Effect {
	[%$TOPIC/cc489982_en-us_VS_110_2_0_2_0_1%]^ get ();
	void set ([%$TOPIC/cc489982_en-us_VS_110_2_0_2_0_2%]^ value);
}
member Effect : [%$TOPIC/cc489982_en-us_VS_110_2_0_3_0_0%] with get, set
function get Effect () : [%$TOPIC/cc489982_en-us_VS_110_2_0_4_0_0%] 
function set Effect (value : [%$TOPIC/cc489982_en-us_VS_110_2_0_4_0_1%])

Property Value

Type: System.Windows.Media.EffectsEffect
An Effect that represents the bitmap effect.
Dependency Property Information

Identifier field

EffectProperty

Metadata properties set to true

None

Remarks

Use the Effect property to apply a bitmap effect to a UIElement.

Examples

The following XAML shows how to assign a custom ShaderEffect to the Effect property.

<Window x:Class="ShaderEffectDemo.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ShaderEffectDemo"
    Title="Window1" Height="300" Width="300">
    <Window.Resources>
        <local:ThresholdEffect x:Key="thresholdEffect" Threshold="0.25" BlankColor="Orange" />
    </Window.Resources>

    <Grid Effect="{StaticResource thresholdEffect}">

    </Grid>
</Window>

Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5 SP1, 3.0 SP2

.NET Framework Client Profile

Supported in: 4, 3.5 SP1