Mega Code Archive

 
Categories / C# / WPF
 

Animate Ellipse RadiusY, RadiusX

<Window x:Class="Main"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   Title="" Height="300" Width="300">   <Grid>     <Path Stroke="Black" StrokeThickness="1">       <Path.Data>         <GeometryGroup>           <EllipseGeometry x:Name="ellipse" Center="150,150" RadiusX="5" RadiusY="5" />         </GeometryGroup>       </Path.Data>       <Path.Triggers>         <EventTrigger RoutedEvent="Path.Loaded">           <BeginStoryboard>             <Storyboard AutoReverse="True" RepeatBehavior="Forever">               <ParallelTimeline Storyboard.TargetName="ellipse">                 <DoubleAnimation To="80" Storyboard.TargetProperty="RadiusX" />                 <DoubleAnimation To="80" Storyboard.TargetProperty="RadiusY" />               </ParallelTimeline>             </Storyboard>           </BeginStoryboard>         </EventTrigger>       </Path.Triggers>     </Path>   </Grid> </Window>