Comment faire pour appeler une méthode d'après un scénario fini?

j'écris le Code suivant:

public void name(object sender, RoutedEventArgs e)
    {
        DoubleAnimation myDoubleAnimation = new DoubleAnimation();
        myDoubleAnimation.From = 1.0;
        myDoubleAnimation.To = 0.0;
        myDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.2));

        sb1 = new Storyboard();
        sb1.Children.Add(myDoubleAnimation);
        Storyboard.SetTargetName(myDoubleAnimation, one.Name);
        Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(Grid.OpacityProperty));
        sb1.Begin(this);

        if (one.Opacity == 0)
        {
            Container_one.Children.Remove(one);
        }     
    }

mais il n'est pas wwork correcte. L'Animation fonctionne bien, mais la Supprimer est faux. Comment puis-je combiner un Storyboard-End avec l'appel d'une methode?

Thnaks beaucoup.

InformationsquelleAutor frank_funk | 2011-09-07