PageRenderTime 21ms CodeModel.GetById 19ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/VBSL3Animation/BasicPointAnimation.xaml

#
XAML | 53 lines | 37 code | 1 blank | 15 comment | 0 complexity | a90ef0e8f2c41704fe84b8b26baa7e70 MD5 | raw file
 1<!--/****************************** Module Header ******************************\
 2* Module Name:  MyPointAnimation.xaml
 3* Project:      VBSL3Animation
 4* Copyright (c) Microsoft Corporation.
 5* 
 6* This module shows how to write baisc PointAnimation for an EllipseGeometry
 7* 
 8* This source is subject to the Microsoft Public License.
 9* See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
10* All other rights reserved.
11* 
12* History:
13* * 9/8/2009 05:00 PM Allen Chen Created
14\***************************************************************************/-->
15    
16    <UserControl x:Class="VBSL3Animation.BasicPointAnimation"
17    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
18    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
19    Width="400" Height="300">
20    <UserControl.Resources>
21        <Storyboard x:Name="MyAnimationStoryboard">
22            <PointAnimation x:Name="MyAnimation"
23                            Duration="0:0:2" 
24                            Storyboard.TargetProperty="Center"
25                            Storyboard.TargetName="MyAnimatedEllipseGeometry">
26            </PointAnimation>
27        </Storyboard>
28    </UserControl.Resources>
29    <Grid x:Name="LayoutRoot" Background="Transparent">
30        <Grid.RowDefinitions>
31            <RowDefinition Height="1*"></RowDefinition>
32            <RowDefinition Height="9*"></RowDefinition>
33        </Grid.RowDefinitions>
34        <StackPanel Grid.Row="0">
35            <TextBlock Text="Please click mouse in the green area."></TextBlock>
36        </StackPanel>
37        <StackPanel MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" x:Name="MyStackPanel" Background="Green"  Grid.Row="1">
38            <Path>
39                <Path.Fill>
40                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
41                        <GradientStop Color="#FFF1F7FB" Offset="0"/>
42                        <GradientStop Color="#FF3794E4" Offset="1"/>
43                    </LinearGradientBrush>
44                </Path.Fill>
45                <Path.Data>
46                    <!-- Describes an ellipse. -->
47                    <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
48          Center="50,50" RadiusX="15" RadiusY="15" />
49                </Path.Data>
50            </Path>
51        </StackPanel>
52    </Grid>
53</UserControl>