How to animate Opacity of a DropShadowEffect?

后端 未结 2 1562
一整个雨季
一整个雨季 2021-02-14 23:18

I have a WPF project with a border using the following style. The plan is to get the glow effect to fade in when the mouse moves over the border, and fade out when it leaves.

2条回答
  •  攒了一身酷
    2021-02-15 00:03

    This is a followup to Simon's answer where I have a ListView where the Template item of the ListViewItem had a DropShadow on a Grid. Long story short, because one is overriding the ListViewItem, the selected item and the hover no longer work. To get those to work I had to modify the Opacity and there are two ways to access the Effect depending on where one is; which I show below...here are Full example of the two snippets:

    Set during Selection