请教wpf语法 Path=(Button.Background).(SolidColorBrush.Color)

lmhcs lmhcs 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

在网上看到一篇文章,部分代码如下

<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) 应该是绑定到按钮背景色,但为什么要加两个括号呢,哪位大声帮忙解释一下 语法,

...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
lmhcs
.NET社区 62,271 成员 668,968 内容