WPF自定义控件的自定义属性绑定后不更新问题
程序员文章站
2022-06-07 13:58:08
...
需要在绑定时设置属性变更触发
UpdateSourceTrigger=PropertyChanged
例如:
<Border CornerRadius="20">
<Border.Background>
<ImageBrush
x:Name="objBackImg"
ImageSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:AnimationVideoPlayer},Path=CoverImage,UpdateSourceTrigger=PropertyChanged}"/>
</Border.Background>
</Border>