Export (0) Print
Expand All

FrameworkContentElement.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
)
public void RegisterName (
	String name, 
	Object scopedElement
)
public function RegisterName (
	name : String, 
	scopedElement : Object
)
You cannot use methods in XAML.

Parameters

name

Name to use for the specified name-object mapping.

scopedElement

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 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 runtime 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 Animating with Storyboards Overview. Animations for content elements are less common than animations on controls, the Animating with Storyboards Overview concentrates on control scenarios.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft