How can I set a property of a DropShadowEffect via a Trigger in a ControlTemplate?

前端 未结 1 1655
一生所求
一生所求 2021-01-03 21:37

I have a Button ControlTemplate and I\'m trying to modify a DropShadowEffect on a Border by using a Trigger.

相关标签:
1条回答
  • 2021-01-03 22:15

    You can set the Effect as a whole in the setter.value

     <Setter Property="Margin" TargetName="ButtonBorder" Value="13,13,7,7" />
        <Setter Property="Effect" TargetName="ButtonBorder" >
          <Setter.Value>
             <DropShadowEffect ShadowDepth="2" />
          </Setter.Value>
        </Setter>
      </Trigger>
    
    0 讨论(0)
提交回复
热议问题