Storyboard.TargetName Attached Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the name of the object to animate. The object must be a FrameworkElement, FrameworkContentElement, or Freezable.
see GetTargetName, and SetTargetName
see GetTargetName, and SetTargetName
see GetTargetName, and SetTargetName
Remarks
Setting this property is optional. If the TargetName is not specified, a storyboard's animations are applied to one of the following:
If the storyboard to which the animation belongs was started using a BeginStoryboard, the element that owns the BeginStoryboard action that triggers the storyboard is targeted.
If the storyboard was started using the Begin method, the FrameworkElement or FrameworkContentElement specified when the storyboard was started with the Begin method is targeted.
When this property is set on a timeline with children, those child timelines "inherit" the parent's TargetName unless they specify their own.
Making an Object Targetable
When using XAML, you perform one of the following two actions to make an object targetable by a storyboard:
If the object is a FrameworkElement or a FrameworkContentElement, set its Name property.
If the object is a Freezable or a custom FrameworkContentElement or FrameworkContentElement, assign it a name using the x:Name Directive markup extension.
When using code, you make an object targetable by using the RegisterName method to assign the object a name.
Dependency Property Information
Identifier field | TargetNameProperty |
Metadata properties set to true |
None |
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈