2012-02-08 12 views
8

क्या कोई ऐसी घटना है जो डब्ल्यूपीएफ एनीमेशन समाप्त होने पर आग लगती है?क्या कोई ऐसी घटना है जो डब्ल्यूपीएफ एनीमेशन समाप्त होने पर आग लगती है?

void HideDefaultScreenImageTimer_Tick(object sender, EventArgs e) 
{ 
    HideDefaultScreenImageTimer.Stop(); 

    var doubleAnimation = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.45))); 
    DefaultScreenImage.BeginAnimation(UIElement.OpacityProperty, doubleAnimation); 
    // I need some event when an animation ENDS and within that event I want to remove 
    // Image (DefaultScreenImage) from Canvas. 
    MainCanvas.Children.Remove(DefaultScreenImage); 
} 

उत्तर

16

हां वहाँ है।

the Completed Event (MSDN)


तो अपने कोड हो जाता है:

void HideDefaultScreenImageTimer_Tick(object sender, EventArgs e) 
{ 
    HideDefaultScreenImageTimer.Stop(); 

    var doubleAnimation = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.45))); 
    doubleAnimation.Completed += (sender, eArgs) => MainCanvas.Children.Remove(DefaultScreenImage); 

    DefaultScreenImage.BeginAnimation(UIElement.OpacityProperty, doubleAnimation); 

} 
संबंधित मुद्दे

 संबंधित मुद्दे