If you want to reuse the effect, you must grab the IsMouseOver trigger and set the Control.Effect property for what you defined in your resources.
<Button Width="100" Content="Hello Glow" > <Button.Style> <Style> <Style.Triggers> <Trigger Property="Button.IsMouseOver" Value="True"> <Setter Property="Button.Effect" Value="{StaticResource MyEffect}" /> </Trigger> </Style.Triggers> </Style> </Button.Style> </Button>
to do this, you must put the effect in the resources of the current page / window / user control
<Window.Resources> <DropShadowEffect x:Key="MyEffect" ShadowDepth="0" Color="Blue" Opacity="1" BlurRadius="20"/> </Window.Resources>
source share