62,204
社区成员
发帖
与我相关
我的任务
分享
在网上看到一篇文章,部分代码如下
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/>
<GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/>
<GradientStop Color="#FFF" Offset="1"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
请问 ,这 Path=(Button.Background).(SolidColorBrush.Color) 应该是绑定到按钮背景色,但为什么要加两个括号呢,哪位大声帮忙解释一下 语法,
Path 后加括号一般说明是附加属性。