如题,鱼眼。特此备注下

wpf,前端动画demo,鱼眼效果_wpf

 1 <Window x:Class="WpfApp2.Window3" 2         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 5         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 6         xmlns:local="clr-namespace:WpfApp2" 7         mc:Ignorable="d" 8         Title="Window3" Height="370" Width="370"> 9     10         <Style TargetType="ListBoxItem">11             <Setter Property="Foreground">12                 13                     <SolidColorBrush Color="Black" />14                 15             16             <Setter Property="FontSize" Value="25" />17             <Setter Property="HorizontalAlignment" Value="Center" />18             19                 <EventTrigger RoutedEvent="ListBoxItem.MouseEnter">20                     21                         <BeginStoryboard Name="aa">22                             23                                 <ColorAnimation From="Black" 24                                                 To="Red"25                                                 Duration="0:0:0.3" 26                                                 Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" />27                                 <DoubleAnimation To="40"28                                                  Duration="0:0:0.25" 29                                                  Storyboard.TargetProperty="FontSize" />30                             31                         32                     33                 34                 <EventTrigger RoutedEvent="ListBoxItem.MouseLeave">35                     36                         "aa"/>-->37                         <BeginStoryboard Name="aa1">38                             39                                 <ColorAnimation From="Red" 40                                                 To="Black"41                                                 Duration="0:0:0.25" 42                                                 Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" />43                                 <DoubleAnimation To="25"44                                                  Duration="0:0:0.2" 45                                                  Storyboard.TargetProperty="FontSize" />46                             47                         48                     49                 50 51                 52                 "{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:Window3},Path=IsSelected}" Value="true">53                                 54                                     "bb">55                                         56                                             "Green" 57                                                             To="Yellow" 58                                                             RepeatBehavior="Forever" 59                                                             Duration="0:0:0.5" 60                                                             Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" />61                                         62                                     63                                 64                             65                             "{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:Window3},Path=IsSelected}" Value="false">66                                 67                                     "bb" />68                                 69                             -->70             71         72     73     74         75             <ListBoxItem Content="001_我" />76             <ListBoxItem Content="002_是" />77             <ListBoxItem Content="003_鱼" />78             <ListBoxItem Content="004_眼" />79             <ListBoxItem Content="005_效" />80             <ListBoxItem Content="006_果" />81             <ListBoxItem Content="007_。" />82             <ListBoxItem Content="008_酷~" />83         84     85