I\'m trying to understand RelativeSource binding but I can\'t find a definition for TemplatedParent. MSDN says:
\"Gets a static value that is used to
Notice:
TemplatedParent means Parent is Templated. Templated is passive voice in English. In other words, the parent element is applied with a Template. So in the template you can binding the parent's property easily.
In WPF, a template is what it uses to construct the tree of a type. WPF essentially makes a copy of the template when a new object of that type is created.
As a result, inside the template, if you want to refer to the new object, you use TemplatedParent
for quick access. Otherwise, you'll have to use RelativeSource
to walk the tree upwards to find the parent object.
TemplatedParent
refers to the Control
instance that the template is being applied to. You can use TemplatedParent
to bind to properties declared on that object (and its base classes).