#562 – Setting an Effect for an Element in Blend
May 21, 2012 3 Comments
You can set the value of the Effect property for any control deriving from UIElement. An effect is a two-dimensional graphical effect applied to the control when it is rendered.
To apply an effect to a control in Blend, start by left-clicking on the Effects folder in the Assets panel.
The .NET Framework comes with two pre-defined effects, located in PresentationCore–BlurEffect and DropShadowEffect. (The other effects shown above come from the Expression SDK for .NET 4). You can drag either of these effects onto a control on the artboard, or a control listed in the Objects and Timeline panel.
Two Label controls, before adding effects:
After adding effects:
Corresponding XAML:
<Label Content="Drop Shadow Effect" FontFamily="Cooper Black" FontSize="48" Margin="20,20,20,5" Foreground="#FF047800" HorizontalAlignment="Center"> <Label.Effect> <DropShadowEffect/> </Label.Effect> </Label> <Label Content="Blur Effect" FontFamily="Cooper Black" FontSize="48" Margin="20,5,20,20" Foreground="#FF047800" HorizontalAlignment="Center"> <Label.Effect> <BlurEffect/> </Label.Effect> </Label>
Pingback: #563 – Additional Effects in Expression SDK « 2,000 Things You Should Know About WPF
Pingback: #564 – Other Places to Get Third Party Effects « 2,000 Things You Should Know About WPF
Pingback: #566 – Setting Properties of an Effect in Blend « 2,000 Things You Should Know About WPF