
PropertyPath for Animation Targets
For animations, a property path is used to define the connection between the named animation target object's property and the intended target animation property, by traversing object-property relationships in the property values.
The target property of an animation must be a dependency property. The property that starts the path must resolve to be the name of a dependency property that exists on the specified Storyboard..::.TargetName type. The targeted property on a type and the eventual animated property can exist on different objects.
Single Property on the Target Object
<animation Storyboard.TargetProperty="propertyName" .../>
propertyName must resolve to be the name of a dependency property that exists on the specified Storyboard..::.TargetName type.
Indirect Property Targeting
<animation Storyboard.TargetProperty="(objectType.propertyName).propertyName2" .../>
objectType must be the type name of a type that has propertyName available as a member.
propertyName must be a property that exists on the specified Storyboard..::.TargetName type.
propertyName2 must be the name of a dependency property that exists on the object that is the value of propertyName. In other words, propertyName2 must exist as a dependency property on the type that is the propertyName property type.
Indirect targeting of animations is necessary because of applied styles and templates. In order to target an animation, you need a TargetName on a target object, and that name is established by x:Name or Name. Although template and style elements also can have names, those names are only valid within the namescope of the style and template. (If templates and styles did share namescopes with application markup, names could not be unique. The styles and templates are literally shared between instances and would perpetuate duplicate names.) Thus, if the individual properties of an element that you might wish to animate came from a style or template, you need to start with a named element instance that is not from a style template, and then target into the style or template visual tree to arrive at the property you wish to animate.
For instance, the Background property of a Panel is a complete Brush (actually a SolidColorBrush) that came from a default template. To animate a Brush completely, there would need to be a BrushAnimation (probably one for every Brush type) and there is no such type. To animate a Brush, you instead animate properties of a particular Brush type. You need to get from SolidColorBrush to its Color to apply a ColorAnimation there. The property path for this example would be Background.Color.
In the multiple objects and sub-properties form, you must use an owning object to disambiguate the initial property and place parentheses around this initial object.property combination. Thereafter, sub-properties need only be named, not qualified with owning types, but those sub-properties must exist on the preceding property's value type. A slightly more verbose form that qualifies subsequent subproperty owning types is also acceptable; for example, "(Rectangle.Fill).(SolidColorBrush.Color)".
Attached Properties
<animation Storyboard.TargetProperty="(ownerType.propertyName)" .../>
The parentheses indicate that this property in a PropertyPath should be constructed using a partial qualification. It can use an XML namespace to find the type. The ownerType searches types that a XAML processor has access to, through the XmlnsDefinitionAttribute declarations in each assembly. Most applications have the default XML namespace mapped to the Silverlight client namespace, so a prefix is usually only necessary for custom types or types otherwise outside that namespace. propertyName must resolve to be the name of a property existing on the ownerType. The property specified as propertyName must be a DependencyProperty. (All Silverlight attached properties are implemented as dependency properties, so this issue is only of concern for custom attached properties.)
Indexers
<animation Storyboard.TargetProperty="propertyName.propertyName2[index].propertyName3" .../>
Most dependency properties do not support an indexer. Therefore, the only usage for an indexer in an animation path is at an intermediate position between the property that starts the chain on the named target and the eventual animated property. In the provided syntax, that is propertyName2. For instance, an indexer usage might be necessary if the intermediate property is a collection such as TransformGroup, in a property path such as RenderTransform.Children[1].Angle.