Reputation: 3130
Consider this WPF3D XAML snippet, bearing in mind that the object declared does not inherit FrameworkElement
:
<Visual3D x:Name="SomeName" />
How, in code, would one go about retrieving the string specified for the value of x:Name
? Yes, it's declared as a symbol for code-behind access at build time, but if you're transforming a logical tree with a non-FrameworkElement
root into a different format, there's no FrameworkElement.NameProperty.GetValue()
defined.
Upvotes: 2
Views: 277
Reputation: 3345
You could create a class which inherit from the Visual 3D class and add the RuntimeNameProperty attribute on the class as well as a property which will be used to save the name.
Upvotes: 1