Silverlight/XAML – Learning by Coding

[ double_animation.xaml --> Grafik anzeigen ]

 1: <?xml version="1.0" encoding="UTF-8"?>
 2: <!-- coded by Thomas Meinike 01/08 -->
 3: <Canvas xmlns="http://schemas.microsoft.com/client/2007"
 4:         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 5: 
 6:   <Rectangle x:Name="rechteck" Width="200" Height="100"
 7:              Canvas.Left="0" Canvas.Top="0" Fill="#6CF"/>
 8:   
 9:   <Canvas.Triggers>
10:     <EventTrigger RoutedEvent="Canvas.Loaded">
11:       <EventTrigger.Actions>
12:         <BeginStoryboard>
13:           <Storyboard>
14:             <DoubleAnimation 
15:               Storyboard.TargetName="rechteck"
16:               Storyboard.TargetProperty="(Canvas.Left)" To="250" Duration="00:00:05"/>
17:             <DoubleAnimation 
18:               Storyboard.TargetName="rechteck"
19:               Storyboard.TargetProperty="(Canvas.Top)" To="250" Duration="00:00:05"/>
20:             <DoubleAnimation 
21:               Storyboard.TargetName="rechteck"
22:               Storyboard.TargetProperty="Opacity" To="0.2" Duration="00:00:05"/>
23:           </Storyboard>
24:         </BeginStoryboard>
25:       </EventTrigger.Actions>
26:     </EventTrigger>
27:   </Canvas.Triggers>
28:   
29: </Canvas>

[zum Anfang]