How to animate Opacity of a DropShadowEffect?

后端 未结 2 1516
心在旅途
心在旅途 2021-02-14 23:34

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:06

    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