Partager via


UIElement.Effect Propriété

Définition

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

public:
 property System::Windows::Media::Effects::Effect ^ Effect { System::Windows::Media::Effects::Effect ^ get(); void set(System::Windows::Media::Effects::Effect ^ value); };
public System.Windows.Media.Effects.Effect Effect { get; set; }
member this.Effect : System.Windows.Media.Effects.Effect with get, set
Public Property Effect As Effect

Valeur de propriété

Qui Effect représente l’effet bitmap.

Exemples

Le code XAML suivant montre comment affecter un code personnalisé ShaderEffect à la Effect propriété.

<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

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

S’applique à

Voir aussi