September 2012
Intermediate to advanced
464 pages
10h 55m
English
So far we've used styles that have a collection of setters. A Style also has a Triggers collection property that provides a declarative way to make some property changes without a need for actual code. As such triggers are part of a style, they are naturally applied to more than one element. There are three types of triggers supported by WPF, and in this recipe we'll examine the simplest one - the property trigger.
Open the CH08.StyledCalculator project.
We'll add an effect when clicking a button in the calculator project using a property trigger:
MainWindow.xaml and look for the style with the key numericStyle ...