How to give a name to InteractiveVisual3D instance

Topics: Developer Forum
Oct 22, 2007 at 7:50 AM
I have a problem in naming the InteractiveVisual3D instance for using against Storeboard for animating it. So please can any one provide me with a sample code Or tell me what is the the problem?

the following is sample code of my user control:

InteractiveVisual3D currentInteractiveVisual3D = new InteractiveVisual3D();
currentInteractiveVisual3D.SetValue(FrameworkElement.NameProperty, "InteractiveVisual3D0");
NameScope.SetNameScope(this, new NameScope());
this.RegisterName("InteractiveVisual3D0" ,currentInteractiveVisual3D);
Storyboard.SetTargetName(translaionAnimation, "InteractiveVisual3D0");
Storyboard.SetTargetProperty(translaionAnimation, new PropertyPath("(Visual3D.Transform).(Transform3DGroup.Children)4.(TranslateTransform3D.OffsetX)"));


the last code line fires an exception that means that InteractiveVisual3D0 does not exist in the namescope of my user control.

Thanks a lot in advance