PageRenderTime 51ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/VBSL3Animation/BasicPointAnimation.xaml.vb

#
Visual Basic | 36 lines | 11 code | 4 blank | 21 comment | 0 complexity | d2eafef463db69b42fd73f7259e7ea95 MD5 | raw file
  1. '***************************** Module Header ******************************\
  2. '* Module Name: MyPointAnimation.xaml.vb
  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. Partial Public Class BasicPointAnimation
  16. Inherits UserControl
  17. Public Sub New()
  18. InitializeComponent()
  19. End Sub
  20. ''' <summary>
  21. ''' Tbe following event handler change the To property of PointAnimation object,
  22. ''' then begin the Storyboard to play the animation. Please note we can change
  23. ''' To property even when the animation is playing.
  24. ''' </summary>
  25. ''' <param name="sender"></param>
  26. ''' <param name="e"></param>
  27. Private Sub StackPanel_MouseLeftButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
  28. Dim targetpoint = e.GetPosition(Me.MyStackPanel)
  29. Me.MyAnimation.To = targetpoint
  30. Me.MyAnimationStoryboard.Begin()
  31. End Sub
  32. End Class