WPF VB.Net Tutorial

  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="" Height="300" Width="300">
  
    
      
                  AutoReverse="True" RepeatBehavior="Forever" />
        
      

    
  

  
    
  


//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Media.Animation
Namespace WpfApplication1
  Public Partial Class Window1
    Inherits Window
    Private opacityClock As AnimationClock
    Private widthClock As AnimationClock
    Public Sub New()
      InitializeComponent()
    End Sub
    Private Sub Button3_Loaded(sender As Object, e As RoutedEventArgs)
      Dim opacityAnimation As New DoubleAnimation(1.0, 0.5, TimeSpan.FromSeconds(1), FillBehavior.HoldEnd)
      opacityAnimation.RepeatBehavior = RepeatBehavior.Forever
      opacityAnimation.AutoReverse = True
      opacityClock = opacityAnimation.CreateClock()
      button3.ApplyAnimationClock(Button.OpacityProperty, opacityClock)
      Dim widthAnimation As New DoubleAnimation(140.0, 50.0, TimeSpan.FromSeconds(1), FillBehavior.HoldEnd)
      widthAnimation.RepeatBehavior = RepeatBehavior.Forever
      widthAnimation.AutoReverse = True
      widthClock = widthAnimation.CreateClock()
      button3.ApplyAnimationClock(Button.WidthProperty, widthClock)
    End Sub
    Private Sub Button3_Click(sender As Object, e As RoutedEventArgs)
      opacityClock.Controller.Remove()
      widthClock.Controller.Remove()
    End Sub
  End Class
End Namespace