Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Team Bloggers

Using Effects in WPF (Part 2)

My previous post on Effects (part of this series ) gives a simple example of instantiating an parameterless Effect (it just takes the complement of a color) through XAML. Here we discuss more about the use of Effects. First, lest you think that Effects are somehow a XAML-only feature, let’s write some code to use Effects. Recall that the invocation of the Effect through XAML looked like this: < Grid > < Grid.Effect > < eff : ColorComplementEffect /> </ Grid.Effect > < Image ... /> < Button ... / > < TextBox ... / > </ Grid > In code, presuming I already have the Grid and it’s called “myGrid”, we’d just do the following: myGrid.Effect = new MyEffects. ColorComplementEffect(); Like everything else in WPF, Effects are readily creatable and manipulable through code. Given that, most of the below will focus on usage through XAML just because it’s the most succinct way of expressing the usage. The ColorComplementEffect is very limited in what it Read More...
Published Monday, May 12, 2008 1:04 PM by Greg Schechter's Blog
Filed under: ,

Comments

No Comments
Anonymous comments are disabled

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us