PageRenderTime 46ms CodeModel.GetById 13ms RepoModel.GetById 0ms 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. <UserControl x:Class="VBSL3Animation.BasicPointAnimation"
  16. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  17. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  18. Width="400" Height="300">
  19. <UserControl.Resources>
  20. <Storyboard x:Name="MyAnimationStoryboard">
  21. <PointAnimation x:Name="MyAnimation"
  22. Duration="0:0:2"
  23. Storyboard.TargetProperty="Center"
  24. Storyboard.TargetName="MyAnimatedEllipseGeometry">
  25. </PointAnimation>
  26. </Storyboard>
  27. </UserControl.Resources>
  28. <Grid x:Name="LayoutRoot" Background="Transparent">
  29. <Grid.RowDefinitions>
  30. <RowDefinition Height="1*"></RowDefinition>
  31. <RowDefinition Height="9*"></RowDefinition>
  32. </Grid.RowDefinitions>
  33. <StackPanel Grid.Row="0">
  34. <TextBlock Text="Please click mouse in the green area."></TextBlock>
  35. </StackPanel>
  36. <StackPanel MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" x:Name="MyStackPanel" Background="Green" Grid.Row="1">
  37. <Path>
  38. <Path.Fill>
  39. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  40. <GradientStop Color="#FFF1F7FB" Offset="0"/>
  41. <GradientStop Color="#FF3794E4" Offset="1"/>
  42. </LinearGradientBrush>
  43. </Path.Fill>
  44. <Path.Data>
  45. <!-- Describes an ellipse. -->
  46. <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
  47. Center="50,50" RadiusX="15" RadiusY="15" />
  48. </Path.Data>
  49. </Path>
  50. </StackPanel>
  51. </Grid>
  52. </UserControl>