WPF TemplateBinding与RelativeSource TemplatedParent
这两个绑定有什么区别:
<ControlTemplate TargetType="{x:Type Button}"> <Border BorderBrush="{TemplateBinding Property=Background}"> <ContentPresenter /> </Border></ControlTemplate>
和
<ControlTemplate TargetType="{x:Type Button}"> <Border BorderBrush="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}"> <ContentPresenter /> </Border></ControlTemplate>
?
倚天杖
开满天机