come posso applicare il seguente effetto ad una window wpf anzichè a Rectangle1
codice:
'avvia l'animazione dei rectangle
Dim myStoryboard As New Storyboard
Dim myDoubleAnimation As DoubleAnimation = New DoubleAnimation()
myDoubleAnimation.From = 1.0
myDoubleAnimation.To = 0.0
myDoubleAnimation.Duration = New Duration(TimeSpan.FromSeconds(1))
myDoubleAnimation.AutoReverse = False
'myDoubleAnimation.RepeatBehavior = RepeatBehavior.Forever
myStoryboard = New Storyboard()
myStoryboard.Children.Add(myDoubleAnimation)
Storyboard.SetTargetName(myDoubleAnimation, Me.Rectangle1.Name)
Storyboard.SetTargetProperty(myDoubleAnimation, New PropertyPath(Rectangle.OpacityProperty))
myStoryboard.Begin(Me)