wpf 模板绑定父对象

有两种方式可以实现在模板中元素绑定到父对象

1、<ContentPresenter Margin=”{TemplateBinding Padding}”/>

2、Color=”{Binding RelativeSource={RelativeSource TemplatedParent},
Path=Background.Color}”/>

posted @ 2019-08-26 14:30  beautifulday  阅读(1050)  评论(0编辑  收藏  举报