Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FrameworkElement::RegisterName Method

Provides an accessor that simplifies access to the NameScope registration method.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
void RegisterName(
	String^ name, 
	Object^ scopedElement
)

Parameters

name
Type: System::String

Name to use for the specified name-object mapping.

scopedElement
Type: System::Object

Object for the mapping.

This method is a convenience method for calling RegisterName. The implementation will check successive parent elements until it finds the applicable NameScope implementation, which is found by finding an element that implements INameScope. For more information about namescopes, see WPF XAML Namescopes.

Calling RegisterName is necessary in order to correctly hook up animation storyboards for applications when created in code. This is because one of the key storyboard properties, TargetName, uses a run-time name lookup instead of being able to take a reference to a target element. This is true even if that element is accessible by reference from the code. For more information on why you need to register names for storyboard targets, see Storyboards Overview.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft