PageRenderTime 25ms CodeModel.GetById 1ms RepoModel.GetById 0ms 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. <UserControl x:Class="VBSL3Animation.CodeBehindCreation"
  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. <Grid x:Name="LayoutRoot" Background="White">
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="1*"></RowDefinition>
  23. <RowDefinition Height="9*"></RowDefinition>
  24. </Grid.RowDefinitions>
  25. <StackPanel Grid.Row="0">
  26. <TextBlock Text="Please click mouse in the gray area."></TextBlock>
  27. </StackPanel>
  28. <StackPanel MouseLeftButtonDown="MyStackPanel_MouseLeftButtonDown" x:Name="MyStackPanel" Background="Gray" Grid.Row="1">
  29. <Path>
  30. <Path.Fill>
  31. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  32. <GradientStop Color="#FFF1F7FB" Offset="0"/>
  33. <GradientStop Color="#FF3794E4" Offset="1"/>
  34. </LinearGradientBrush>
  35. </Path.Fill>
  36. <Path.Data>
  37. <!-- Describes an ellipse. -->
  38. <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
  39. Center="50,50" RadiusX="15" RadiusY="15" />
  40. </Path.Data>
  41. </Path>
  42. </StackPanel>
  43. </Grid>
  44. </UserControl>