Esempio n. 1
0
        private static void ImageControlUnloaded(object sender, RoutedEventArgs e)
        {
            if (!(sender is Image imageControl))
            {
                return;
            }
            ImageSource source = GetAnimatedSource(imageControl);

            if (source != null)
            {
                AnimationCache.DecrementReferenceCount(source, GetRepeatBehavior(imageControl));
            }
            ImageAnimationController controller = GetAnimationController(imageControl);

            if (controller != null)
            {
                controller.Dispose();
            }
        }