Closed HHChaos closed 6 years ago
Do you have a repo for this? I don't think that is the right solution for your problem. I think it's just a simple lock block.
I'm sorry I confused you,I create a simple repo for it. https://github.com/HHChaos/LottieUwpTest2 This problem only occurs when you set LottieComposition in your behind code. Everything is fine if you set FileName in xaml file. And I found that if LottieComposition is set in the behind code, the setting of _useHardwareLayer will not take effect(see the screenshot below for reasons), so I made changes in this PR
I guess the bug was caused by the difference in the CanvasAnimatedControl Device on the same page(different Device when the ForceSoftwareRenderer is true or false).My modification keeps the Device consistent, so that they don't trigger the bug. There should be a better solution, but I don't know yet.
When you set _useHardwareLayer=true, a factory class exception will be raised if you use both LottieAnimationView and LottieDrawable on a xaml page.
System.Exception:“The objects used together must be created from the same factory instance (Exception from HRESULT: 0x88990012)”