Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lottie Animation in WinUI 3

I am trying to implement lottie animation in a WinUI 3 app. Previously it was implemented in UWP. Where I used AnimatedVisualPlayer from Microsoft.UI.Xaml.Controls and LottieVisualSource from Microsoft.Toolkit.Uwp.UI.Lottie. The code snippet is shown here,

<AnimatedVisualPlayer Stretch="None">
    <LottieVisualPlayer UriSource="AnimatedImage.json" />
</AnimatedVisualPlayer>

But in WinUI3 I cannot find any alternate for AnimatedVisualPlayer. Is there any alternate way to use Lottie Animation in WinUI 3?

like image 828
Sumnoon Avatar asked Jan 24 '26 13:01

Sumnoon


1 Answers

You should need to install the CommunityToolkit.WinUI.Lottie NuGet package.

<Page
...
    xmlns:lottie="using:CommunityToolkit.WinUI.Lottie">

    <AnimatedVisualPlayer x:Name="LottiePlayer">
        <lottie:LottieVisualSource x:Name="LottieJsonSource" UriSource="ms-appx:///AnimatedVisuals/LottieLogo1.json"/>
    </AnimatedVisualPlayer>

</Page>
like image 96
Andrew KeepCoding Avatar answered Jan 26 '26 01:01

Andrew KeepCoding



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!