有人会解释这个TemplateBinding绑定到什么?
// excerpt of a Style that applies to an ItemsControl
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<local:PiePanel Values="{TemplateBinding local:PiePanel.Values}"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
PiePanel定义了DependencyProperty
public static readonly DependencyProperty ValuesProperty =
DependencyProperty.RegisterAttached("Values", typeof(ObservableCollection<double>), typeof(PiePanel), ...
AFAIK,TemplateBinding转换为
<local:PiePanel Values={Binding RelativeSource={RelativeSource TemplatedParent}, Path=local:PiePanel.Values}" />
那么值绑定到Child的Values属性,该属性在Child中定义?我的解释是否正确?未为Parent定义Values属性(在本例中为Style的TargetType)。