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