TargetName Attached Property
Collapse the table of content
Expand the table of content

Storyboard.TargetName Attached Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the name of the object to animate.

Namespace:  System.Windows.Media.Animation
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

See GetTargetName, SetTargetName
<object Storyboard.TargetName="nameString"/>

XAML Values


The Name (orx:Name) value of the element where the property to be animated exists.

Property Value

Type: System.String
The name of the object to animate.

Dependency property identifier field: TargetNameProperty

The value of Storyboard.TargetName must refer to an existing element that has that same string assigned as its Name or x:Name attribute. For details, see the "Creating a Storyboard" section of Animations, motion, and output for Windows Phone.

Attempting to set Storyboard.TargetName on a running animation will cause a run-time error. However, you can retarget an existing animation is stopped or not yet running. If you do so, be careful not to retarget an animation to the wrong type of target (one that does not possess the existing Storyboard.TargetProperty). Otherwise, you will get a run-time error.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2018 Microsoft