开发者

DataTrigger with Value Binding

Why this doesn't work?

 <Style x:Key="ItemContStyle" TargetType="{x:Type Lis开发者_StackOverflow社区tViewItem}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=Asset}" 
          Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}},
                       Path=CurrentAsset}">
                <Setter Property="Background" Value="Red" />
            </DataTrigger>
  </Style.Triggers>


Because DataTrigger.Value is not a dependency property.


Used StyleSelector instead...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜