WPF的外发光按钮实现

实现了当移近按钮的时候,按钮显现外发光的特效,用WPF实现比较容易。
<Window.Resources>
        <Style TargetType="{x:Type Button}">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <!--Setter Property="Background" Value="Orange"></Setter-->
                    <Setter Property="BitmapEffect">
                        <Setter.Value>
                            <OuterGlowBitmapEffect GlowSize="20" Noise=".3" GlowColor="Red"></OuterGlowBitmapEffect>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    
	<Grid x:Name="LayoutRoot">
		<Button x:Name="button" Margin="200,160,240,182" Content="Button" MouseEnter="button_MouseEnter"> 
		</Button>
	</Grid>

你可能感兴趣的:(xml,WPF)