Object references obtained by walking the logical tree from the root, or by typical name references, do not come from a template.Cases where TemplatedParent might not be null include operations such as hit-testing, event handling for certain low-level input events, walking the visual tree with VisualTreeHelper, or working with enumerators, which might return elements that came from templates.