UIElement.Effect Propriété

Définition

Obtient ou définit l'effet bitmap à appliquer à UIElement. Il s’agit d’une propriété de dépendance.

C#
public System.Windows.Media.Effects.Effect Effect { get; set; }

Valeur de propriété

Effect

Effect qui représente l'effet bitmap.

Exemples

Le code XAML suivant montre comment affecter une propriété personnalisée ShaderEffect Effect .

XAML
<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>

Remarques

Utilisez la Effect propriété pour appliquer un effet bitmap à un UIElement.

Informations sur les propriétés de dépendance

Champ d’identificateur EffectProperty
Propriétés de métadonnées définies sur true Aucun

S’applique à

Produit Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7

Voir aussi