Back in this post I showed you how you can easily add a fade-in / fade-out effect to a UIElement that changes its Visibility property, using a simple attached property.
Some people encountered a problem using this property when they bind the UIElement to a model which initially hides the control. Since the default value of the Visibility property is Visible, using the attached property created an unwanted fade-out animation when the application started.
To fix this issue I added another attached property that allows the user to skip the first animation.
Also, I’ve fixed a minor issue with the double animation of the opacity.
For completion, I bring here the full updated source. For more details on how the animation works, check the original post.
That’s it for now, Arik Poznanski.
Appendix A – Updated Source Code for VisibilityAnimation class