PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/Visual Studio 2008/VBSL3Animation/CodeBehindCreation.xaml

#
XAML | 45 lines | 28 code | 1 blank | 16 comment | 0 complexity | a3852c08454c2ffc881d8f00346f0af3 MD5 | raw file
 1<!--/****************************** Module Header ******************************\
 2* Module Name:  CodeBehindCreation.xaml
 3* Project:      VBSL3Animation
 4* Copyright (c) Microsoft Corporation.
 5* 
 6* This module shows how to initialize a Storyboard in code behind. The final effect
 7* is the same as BasicPointAnimation.xaml, which uses XAML to add Storyboard.
 8* 
 9* This source is subject to the Microsoft Public License.
10* See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
11* All other rights reserved.
12* 
13* History:
14* * 9/10/2009 03:00 PM Allen Chen Created
15\***************************************************************************/-->
16    
17    <UserControl x:Class="VBSL3Animation.CodeBehindCreation"
18    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
19    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
20    Width="400" Height="300">
21    <Grid x:Name="LayoutRoot" Background="White">
22        <Grid.RowDefinitions>
23            <RowDefinition Height="1*"></RowDefinition>
24            <RowDefinition Height="9*"></RowDefinition>
25        </Grid.RowDefinitions>
26        <StackPanel Grid.Row="0">
27            <TextBlock Text="Please click mouse in the gray area."></TextBlock>
28        </StackPanel>
29        <StackPanel MouseLeftButtonDown="MyStackPanel_MouseLeftButtonDown"  x:Name="MyStackPanel" Background="Gray"  Grid.Row="1">
30            <Path>
31                <Path.Fill>
32                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
33                        <GradientStop Color="#FFF1F7FB" Offset="0"/>
34                        <GradientStop Color="#FF3794E4" Offset="1"/>
35                    </LinearGradientBrush>
36                </Path.Fill>
37                <Path.Data>
38                    <!-- Describes an ellipse. -->
39                    <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
40          Center="50,50" RadiusX="15" RadiusY="15" />
41                </Path.Data>
42            </Path>
43        </StackPanel>
44    </Grid>
45</UserControl>