September 2012
Intermediate to advanced
464 pages
10h 55m
English
Property-based animations are certainly the most common animations to use. WPF supports another form of animation – path-based animation; that is, an animation that runs along a PathGeometry. Let's see how to achieve that.
Make sure Visual Studio is up and running.
We'll create a circle that moves along a path laid out by a PathGeometry object:
CH09.PathBasedAnimation.MainWindow.xaml. Add a PathGeometry object to the Resources property of Window that describes a rectangular path:<Window.Resources> <PathGeometry x:Key="rg"> <PathFigure IsClosed="True" StartPoint="20,20"> <PolyLineSegment Points="300,20 300,200 20,200 20,200" /> </PathFigure> </PathGeometry> ...